COUNTIF Question

KolbyPanda

New Member
Joined
Jul 3, 2018
Messages
6
Greetings!
I have this formula to display "ALS" if a cell contains the word "Paramedic" anywhere in the string and display "BLS" if the string does not contain "Paramedic".

=IF(COUNTIF(A1:A16,"*Paramedic*"),"ALS","BLS")

What I wish to do is instruct the cell to display one of three options.

1. If the source cells contains the word "Paramedic" anywhere in the cell then display "ALS"
2. If the source cells contains the word "EMT" anywhere in the cell then display "BLS"
3. If the source cells are empty then display "Not Staffed"

The current formula works great for the first two options, I just cant figure out how to add the third one.

Thanks in advance!
- Kolby
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Presuming cell A1 is your source, then use the below.
You can just drag the formula down to whatever row your data ends.

Code:
=IF(A1="Paramedic","ALS",IF(A1="EMT","BLS",IF(A1="","Not Staffed")))
 
Upvote 0
@Foz1980; That wont work, OP is looking for "Paramedic" anywhere in the string
@kollyPanda

=IF(COUNTIF(A1:A16,"*Paramedic*")>1,"ALS",IF(COUNTIF(A1:A16,"*EMT*")>1,"BLS","Not Staffed"))

QUESTION: What result do you want if A1:A16 contain BOTH Paramedic AND EMT ?
 
Upvote 0
@Foz1980; That wont work, OP is looking for "Paramedic" anywhere in the string
@kollyPanda

=IF(COUNTIF(A1:A16,"*Paramedic*")>1,"ALS",IF(COUNTIF(A1:A16,"*EMT*")>1,"BLS","Not Staffed"))

QUESTION: What result do you want if A1:A16 contain BOTH Paramedic AND EMT ?
Ahh yes, fair point. I had misunderstood the original question.
 
Upvote 0
Special-k99

Wouldnt it be >0 or >=1 instead of >1?

Hi,

Actually, even that's not needed, this will do just as well:

=IF(COUNTIF(A1:A16,"*Paramedic*"),"ALS",IF(COUNTIF(A1:A16,"*EMT*"),"BLS","Not Staffed"))
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,204
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top