search function

  • Thread starter Thread starter red
  • Start date Start date
R

red

I am trying to search fro two pieces of infomation from one cell.
For one piece i have used =IF(LEFT(J11,2)="Ph",L11,""). What i want to be
able to do is search for either "Ph" or "In" from the same cell. Is this
possible? I think i have seen this done by setting a special function and
VB!!
 
Focusing on just this line
.. i want to .. search for either "Ph" or "In" from the same cell

One way, you could use this test in say, B1, copied down:
=SUMPRODUCT(--ISNUMBER(SEARCH({"Ph","In"},A1)))>0
Adapt to suit

If you need it to be a stricter case sensitive search,
replace SEARCH with FIND

High-five? Click YES below
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,500 Files:370 Subscribers:66
xdemechanik
---
 
red said:
Thanks guys, works a treat!!

But .. somehow you din't high-five my response? The expression addresses the
generic scenario where you're fuzzy searching for the existence of a couple
of substrings within a cell. This could come in real handy one fine day.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,500 Files:370 Subscribers:66
xdemechanik
---
 
Maybe, judging from the original post, that solution is too generic and
wrong if it counts say Ph within a cell whereas he/she only wants to count
when it starts.
 
Back
Top