Formulas within formulas

jason-t

New Member
Joined
Feb 25, 2011
Messages
1
Hi all i need some little help what i am trying to do is in one cell get the answer for this. I have three cells b2,c2,d2 only one has value and depending on what one it is it is true for that cell now when its true i want it to look up on sheet2 two columns now if b2 is true then look up sheet2 column a,b and if c2 is true then look up sheet 2 column a,c and if d2 is true then look up sheet 2 a,d now the formula i am trying to us looks like this

=IF(B2,(HLOOKUP(A1,SHEET2!A,B)))+IF(C2,(HLOOKUP(A1,SHEET2!A,C)))+IF(D2,(HLOOKUP(A1,SHEET2!A,D)))

But it does not want to work can any one help???/
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi, welcome to the board.

First, do B2/C2/D2 actually contain the logical TRUE values ?
It looks, from your formula, as if they do, so I'll assume they do.

Maybe you need something like this.

Code:
=if(b2,vlookup(a1,sheet2!A:B,2,false),if(c2,vlookup(a1,sheet2!A:C,3,false),
if(d2,vlookup(a1,sheet2!A:D,4,false),XXX)))

Replace XXX with whatever you want to do if b2, c2 and d2 are all false.

Make sure you understand what the "false" part does.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

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