Combining HLOOKUP and IF statements

ehardway123

New Member
Joined
May 24, 2013
Messages
22
Hey all,

I am stuck on this formula. So I created key to lookup and match a type a for a month to get a value. Some the keys do not have a value (meaning key is non existent) for a month so it returns as #N/A in the cell. This is the lookup formula I have.
=HLOOKUP(I4,'BL!A:M1095,MATCH(CALC!B9,A2:A1095,0),FALSE)

how can I get the return values that are #N/A to be zero instead? I know an IF statement can but I haven't been able to figure it out. Please help!


Erica
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
The simplest way is with IFERROR:

=IFERROR(HLOOKUP(I4,'BL!A:M1095,MATCH(CALC!B9,A2:A1095,0),FALSE),0)

HTH,
 
Upvote 0
Wrap it within an IFERROR statement, like this:
Code:
=[COLOR=#ff0000]IFERROR([/COLOR]HLOOKUP(I4,'BL!A:M1095,MATCH(CALC!B9,A2:A1095,0),FALSE)[COLOR=#ff0000],0)[/COLOR]

edit - I see Smitty beat me to it!
 
Upvote 0

Forum statistics

Threads
1,215,457
Messages
6,124,941
Members
449,197
Latest member
k_bs

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