IF statement issues

Ozzie2842

New Member
Joined
Jan 16, 2009
Messages
35
I'm using the following formula to calculate prices for products. It works well if Cell C2 is blank. However, I want to look up a different price (column 3 in the vlookup) if we type anything in Cell C2.

=IF(D2="","",IF(C2="",VLOOKUP(D2,$I$2:INDEX($I$2:$K$20,COUNTA($I$2:$I$20),2),2,0)))

I'm not getting where to include this additional formula to get this to work=VLOOKUP(D2,$I$2:INDEX($I$2:$K$20,COUNTA($I$2:$I$20),3),3,0)))

If this is too confusing, I'll upload the spreadsheet. Thanks in advance for having a look.

Oz
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I'm using the following formula to calculate prices for products. It works well if Cell C2 is blank. However, I want to look up a different price (column 3 in the vlookup) if we type anything in Cell C2.

=IF(D2="","",IF(C2="",VLOOKUP(D2,$I$2:INDEX($I$2:$K$20,COUNTA($I$2:$I$20),2),2,0)))

I'm not getting where to include this additional formula to get this to work=VLOOKUP(D2,$I$2:INDEX($I$2:$K$20,COUNTA($I$2:$I$20),3),3,0)))

If this is too confusing, I'll upload the spreadsheet. Thanks in advance for having a look.

Oz
Try this...

=IF(D2="","",VLOOKUP(D2,$I$2:INDEX($K$2:$K$20,COUNTA($I$2:$I$20)),2+(C2<>""),0))
 
Upvote 0

Forum statistics

Threads
1,203,398
Messages
6,055,168
Members
444,767
Latest member
bryandaniel5

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