VLOOKUP Results stopping after the second

cheezboycheez

New Member
Joined
Sep 25, 2008
Messages
3
I've created an invoice form which uses the Invoice number to return the results, there are multiples of the same number, say there could be 4 different lines using invoice number 72. So far I've created my vlookup fields as (First line)

=VLOOKUP(E4,'Invoice Sheet'!A:M,3,0)

and then following, so it doesn't repeat the same line/ and doesn't display #n/a

=IF(VLOOKUP(E4,'Invoice Sheet'!A:M,3,1)<=A15,"",VLOOKUP(E4,'Invoice Sheet'!A:M,3,1))

This seems to work fine, except when it gets to line 3

=IF(VLOOKUP(E4,'Invoice Sheet'!A:M,3,2)<=A16,"",VLOOKUP(E4,'Invoice Sheet'!A:M,3,2))

Which returns no data...... when it should be.
Any ideas?

Andy
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi & welcome,

2 isn't a valid setting for the last part of the VLOOKUP function. You can only use 0 (or FALSE) for an exact match or 1 (or TRUE) for a nearest match.

Dom
 
Upvote 0
I've created an invoice form which uses the Invoice number to return the results, there are multiples of the same number, say there could be 4 different lines using invoice number 72. So far I've created my vlookup fields as (First line)

=VLOOKUP(E4,'Invoice Sheet'!A:M,3,0)

and then following, so it doesn't repeat the same line/ and doesn't display #n/a

=IF(VLOOKUP(E4,'Invoice Sheet'!A:M,3,1)<=A15,"",VLOOKUP(E4,'Invoice Sheet'!A:M,3,1))

This seems to work fine, except when it gets to line 3

=IF(VLOOKUP(E4,'Invoice Sheet'!A:M,3,2)<=A16,"",VLOOKUP(E4,'Invoice Sheet'!A:M,3,2))

Which returns no data...... when it should be.
Any ideas?

Andy

A question and an observation:

Are you wanting to return the value in the third column of only the first instance of the invoice number, or every instance?

And just to clarify, the fourth argument in a VLOOKUP is not an "offset" type argument, it just stipulates whether an exact match (FALSE) or an approximate match (TRUE) is required. FALSE can be represented by 0, and TRUE can be represented by 1, 2 or 5563. :)

edit: beaten
 
Last edited:
Upvote 0
It is possible, if you do a search for 'lookup multiple results' you should see quite a few posts along the same lines.

Dom
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,310
Members
452,634
Latest member
cpostell

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