Formula with multiple conditions

rob1987

New Member
Joined
Feb 14, 2011
Messages
39
Hello,

Please can somebody help me structure my formula? I currently use the following formula to look up a value dependent on the what text is contained within cells b1 + c1. :

{=INDEX('Feb 11'!S822:S835,MATCH(example!B1&example!C1,'Feb 11'!F822:F841 &'Feb 11'!G822:G841,0))} (I'll call this formula A)

I want to edit it so that the above formula is used if both b1 + c1 contain text, but...

{=INDEX('Feb 11'!S822:S835,MATCH(example!B1,'Feb 11'!F822:F841 &'Feb 11'!,0))} (I'll call this formula B)

is used if only B1 conatins text and c1 is blank, or...

{=INDEX('Feb 11'!S822:S835,MATCH(example!C1,'Feb 11'!G822:G841,0))}
(I'll call this formula C)

is used if b1 is blank and c1 contains text.

I assume my formula will have to take the Form of: IF B1 and C1 contain text, then use formula A, If C1 is blank then use Formula B, if B1 is blank then use formula C. But I have no idea how to make this into a formula.

Can anybody please help?

Much appreciated, thank you!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,115
Maybe something like this . . .
Code:
=if(and(istext(b1),istext(c1)),[formula A],if(and(istext(b1),isblank(c1)),
[formula B],if(istext(c1),[formula C],[formula D])))

I haven't tested this, but I think it should work like this
b1 is text, c1 is text, formula A
b1 is text, c1 is blank, formula B
b1 is blank, c1 is text, formula C
b1 is blank, c1 is blank, formula D

I haven't done any analysis of your formulas to see if they can be improved on.
 

Watch MrExcel Video

Forum statistics

Threads
1,132,783
Messages
5,655,273
Members
418,184
Latest member
snoogz2

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
Top