IF Problem

aivoryuk

Board Regular
Joined
Nov 18, 2009
Messages
130
Hi

I have the following problem
=IF(ISBLANK(F11),0,LOOKUP(F11,{"H","M","L"},{1000,500,0}))

The problem I have that when if the cell (f11) has a L is returns 1000 instead of 0. it works fine if the value is H or M.

Where is it going wrong?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi. Try (alphabetical order)

=IF(ISBLANK(F11),0,LOOKUP(F11,{"H","L","M"},{1000,0,500}))
 
Upvote 0
Lookup expects the values in the first {} to be sorted ascending (=alphabetical for text).
 
Upvote 0
Hi

I have the following problem
=IF(ISBLANK(F11),0,LOOKUP(F11,{"H","M","L"},{1000,500,0}))

The problem I have that when if the cell (f11) has a L is returns 1000 instead of 0. it works fine if the value is H or M.

Where is it going wrong?
The lookup_array *must* be sorted in ascending order.

Assuming that the only possible entries are an empty cell, H, L or M, here's another way to do it:

=IF(OR(F11={"","L"}),0,IF(F11="H",1000,500))
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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