ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Want VLookup to Return the row above (https://www.excelbanter.com/excel-worksheet-functions/23332-want-vlookup-return-row-above.html)

JoOwl0

Want VLookup to Return the row above
 
I have the VLOOKUP function:
=VLOOKUP(G1360,D4:G1358,COLUMNS(D1:G1))

which is properly returning the value in row G which corresponds to the
value in G1360. How do I get it to return the value in the row above
the row which has the value in G1360?


JoOwl0

Replace with:
I have the VLOOKUP function:
=VLOOKUP(G1360,D4:G1358,COLUMNS(D1:G1))

which is properly returning the value in some row which corresponds to
the value in G1360. How do I get it to return the value in the row
above the row which has the value in G1360?
Hanging red-faced head.....


Niek Otten

=INDEX(D4:G1358,MATCH(G1360,D4:G1358)-1,COLUMNS(D1:G1))

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"JoOwl0" wrote in message
oups.com...
I have the VLOOKUP function:
=VLOOKUP(G1360,D4:G1358,COLUMNS(D1:G1))

which is properly returning the value in row G which corresponds to the
value in G1360. How do I get it to return the value in the row above
the row which has the value in G1360?




JoOwl0

Oops, that gives #NA.
=INDEX(D4:G1358,MATCH(G1360,D4:G1358)-1,COLUMNS(D1:G1))
But thanks anyway


Ron Rosenfeld

On 23 Apr 2005 07:24:55 -0700, "JoOwl0" wrote:

Replace with:
I have the VLOOKUP function:
=VLOOKUP(G1360,D4:G1358,COLUMNS(D1:G1))

which is properly returning the value in some row which corresponds to
the value in G1360. How do I get it to return the value in the row
above the row which has the value in G1360?
Hanging red-faced head.....


I don't think you can. However, you could use INDEX and MATCH to do that:

=INDEX(D4:G1358,MATCH(G1360,D4:D1358,0)-1,COLUMNS(D1:G1))


--ron

Niek Otten

Sorry,

=INDEX(D4:G1358,MATCH(G1360,D4:D1358)-1,COLUMNS(D1:G1))

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel


"JoOwl0" wrote in message
ups.com...
Oops, that gives #NA.
=INDEX(D4:G1358,MATCH(G1360,D4:G1358)-1,COLUMNS(D1:G1))
But thanks anyway




JoOwl0

=INDEX(D4:G1358,MATCH(G1360,D4:D1358,0)-1,COLUMNS(D1:G1))
Thanks, Ron, it worked a charm!


JoOwl0

Thanks, I should have looked more carefully and seen the problem myself.


Ron Rosenfeld

On 23 Apr 2005 07:49:46 -0700, "JoOwl0" wrote:

=INDEX(D4:G1358,MATCH(G1360,D4:D1358,0)-1,COLUMNS(D1:G1))
Thanks, Ron, it worked a charm!



Glad to help. Thanks for the feedback


--ron


All times are GMT +1. The time now is 09:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com