Vlookup and when to stop

Tunaman72

New Member
Joined
May 17, 2010
Messages
13
I have created a list of part numbers, and am using a drop down screen to select part numbers (nearly 500). In the second and third column I am using vlookup so that I can get prices, which I want to total at the end. However, if I copy and paste the vlookup formula to a maximum of say 20 possible part numbers, if use only 5, there is an error message on the remaining 15 which means I can't get a total. Is there a way of ignoring the formula in cell B6 if, for example cell A6 is empty, but using it if A6 has something in it?
I am using Excel for mac 2008.

I would be very grateful for any assistance
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi Tunaman72

You might be able to evaulate the VLOOKUP and leave it blank or 0 if there is nothing in the A column

=IFERROR(VLOOKUP(A2, Range, 2, 0), "") '..Change the "" to 0 to return a blank.

I'm fairly sure IFERROR will work in MacOffice2008 but if not you can use

=IF(ISERROR(VLOOKUP(A2, Range, 2, 0)), "", VLOOKUP(A2, Range, 2, 0)) again with the ""

Regards

Dave
 
Upvote 0
Hi and welcome to the board!!
You can adjust your formula to avoid the error. Something like
Code:
=IF(ISERROR(yourVLOOKUP),"",yourVLOOKUP)
Or maybe in B2, copied down
Code:
If (A2="","",yourVOOKUP)
where Column "A" has your dropdown and Column "B" has your formulas.
There might be other ways using code. If interested, post back with details/

lenze
 
Upvote 0
Dave,

The first one got it, many thanks

Tunaman


Hi Tunaman72

You might be able to evaulate the VLOOKUP and leave it blank or 0 if there is nothing in the A column

=IFERROR(VLOOKUP(A2, Range, 2, 0), "") '..Change the "" to 0 to return a blank.

I'm fairly sure IFERROR will work in MacOffice2008 but if not you can use

=IF(ISERROR(VLOOKUP(A2, Range, 2, 0)), "", VLOOKUP(A2, Range, 2, 0)) again with the ""

Regards

Dave
 
Upvote 0
Lenze,
Many thanks for your reply, didn't attempt, as Dave's did the trick, but thanks anyway.


Hi and welcome to the board!!
You can adjust your formula to avoid the error. Something like
Code:
=IF(ISERROR(yourVLOOKUP),"",yourVLOOKUP)
Or maybe in B2, copied down
Code:
If (A2="","",yourVOOKUP)
where Column "A" has your dropdown and Column "B" has your formulas.
There might be other ways using code. If interested, post back with details/

lenze
 
Upvote 0

Forum statistics

Threads
1,222,902
Messages
6,168,938
Members
452,227
Latest member
sam1121

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