Using "if" formula

B.Kellough

Board Regular
Joined
Aug 1, 2009
Messages
180
Does anyone know of a way to use a "IF" formula to check for multiple criteria and if the first criteria isn't met then it looks for the second criteria, and so on; and once it finds the correct match then it would bring back the inputted result.

for example:

=if(b3."1","1")+if(b4,"2","2")+if(etc.

I know that formula isn't what I need but was hoping it would provide an example of what I'm trying to achive.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
You probably wouldn't use IF. You could nest up to seven IFs but there are so many looking up, matching, indexing and choosing functions, you'd probably use one of those for the sake of simplicity. Why do you specifically want to restrict yourself to using IF? That's not really what it's best at doing.

Tell us what you're really trying to do!
 
Upvote 0
This is what I ended up using and this does work; but if anyone knows of a better formula, I'm always willing to learn.

=IF(D3=1,0,IF(E3=1,1,IF(F3=1,2,IF(G3=1,3,IF(H3=1,4,IF(I3=1,5,IF(J3=1,6,0)))))))

Thanks.
 
Upvote 0
This will do the job if you can guarantee there will be at least one "1" in the range:-
Code:
=MATCH(1,D3:J3,FALSE)-1

If you can't guarantee that, then it needs to be wrapped up in some error checking:-
Code:
=IF(ISNA(MATCH(1,D3:J3,FALSE)),0,MATCH(1,D3:J3,FALSE)-1)
 
Upvote 0

Forum statistics

Threads
1,224,514
Messages
6,179,220
Members
452,895
Latest member
BILLING GUY

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