View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default Using IF function in excel to search for text across cells and she

You can put SUM around it like so:

=SUM(IF(D2:D5="RAB",1,0))

then commit with CTRL-SHIFT-ENTER to make it an array function.

Hope this helps.

Pete

shail wrote:
Hi Paul,

That will definitely return 1, but Rup might want to count the number
of thimes "RAB" are appearing. Not just want to know it these are
there.

Shail


paul wrote:
your formula will work if you enter it by pressing ctrl and shift and enter
together
if "rab" is in any one of those cells you will get
your formula will look like this
{=IF(D2:D5="RAB",1,0)}
the curly brackets indicate an array formula which will come automatically
upon using the crl shift enter keys together you cant type the {} yourself


--
paul

remove nospam for email addy!



"Rup1776" wrote:

I am trying to use the IF function to search for a certain abbreviation
across a number of different cells across several sheets. I.e. to count the
number of cells containing this abbreviation.

I have been able to use this for one cell using :

IF(D5="RAB",1,0)

I.e. if D5 contains RAB count 1, otherwise count 0.

How would I reproduce this for a range of cells?
Using the same principle :

IF(D2:D5="RAB",1,0)
However this gives me a result of 0 (when it should be 1)

Im not that experienced with excel so am I using the wrong formula or not
filling correctly, any suggestions?