formula with IF and LOOKUP not working correctly

jb00976

New Member
Joined
Oct 23, 2017
Messages
33
I have the following Formula:

=IF($D23="M/L",LOOKUP($F23,$M$12:$M$15,$N$12:$N$15))

Column D has values of "Hybrid", "Small" and "M/L"

Column F has values of "G7", "G8", "G9" and "G10"

M12:M15 and N12:N15 looks like this:

[TABLE="class: grid, width: 500"]
<colgroup><col style="width:88pt" width="117" span="2"> </colgroup><tbody>[TR]
[TD="width: 117"]G7
[/TD]
[TD="width: 117"]$40,000[/TD]
[/TR]
[TR]
[TD="width: 117"]G8[/TD]
[TD="width: 117"]$50,000
[/TD]
[/TR]
[TR]
[TD="width: 117"]G9[/TD]
[TD="width: 117"]$60,000[/TD]
[/TR]
[TR]
[TD="width: 117"]G10[/TD]
[TD="width: 117"]$75,000[/TD]
[/TR]
</tbody>[/TABLE]

For some reason when the value in column F is G10 it is returning "#N/A" instead of $75,000. When the value is G7, G8 or G9 the formula works.

Please help!

Thank you
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Lookup only does approximant match which requires the table to be sorted. If your table your get

Book1
MN
12G10$75,000
13G7$40,000
14G8$50,000
15G9$60,000
Sheet1


And then you get 75,000 from you lookup formula.

If you do not want to sort the range you can use. This will be an exact match lookup so if the value is not found it will hive a N/A error
Code:
=INDEX(N12:N15,MATCH(F23,M12:M15,0))
 
Upvote 0
How about:

<b>Sheet</b><br /><br /><table border="1" cellspacing="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:80px;" /><col style="width:80px;" /><col style="width:80px;" /><col style="width:80px;" /><col style="width:80px;" /><col style="width:80px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >A</td><td >D</td><td >F</td><td >G</td><td >M</td><td >N</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >11</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >12</td><td > </td><td > </td><td > </td><td > </td><td >G7</td><td style="text-align:right; ">$40,000</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >13</td><td > </td><td > </td><td > </td><td > </td><td >G8</td><td style="text-align:right; ">$50,000</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >14</td><td > </td><td > </td><td > </td><td > </td><td >G9</td><td style="text-align:right; ">$60,000</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >15</td><td > </td><td > </td><td > </td><td > </td><td >G10</td><td style="text-align:right; ">$75,000</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >16</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >22</td><td > </td><td > </td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >23</td><td > </td><td >M/L</td><td >G10</td><td style="text-align:right; ">$75,000</td><td > </td><td > </td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b>Formula</b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >G23</td><td >=IF(D23="M/L",VLOOKUP(F23,M12:N15,2,0))</td></tr></table></td></tr></table> <br /><br />
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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