VLookup to return the last value of a row based on criteria

tarek

New Member
Joined
Nov 21, 2006
Messages
24
Hi,

I've been researching below issue for couple of days with out any luck of a solution:

I am trying to create a formula which return the last value in a row based on a client name example:

Column A (client name).......Column B (Data1).......Column C (Data2).............Column D (Data3).......
ClientA....................................6...............................2.......................................4....................
ClientB.................................................................... 3
ClientC..............................................................................................................5...................
ClientD
ClientE


Formula should return:
ClientA: 4
ClientB: 3
ClientD: 5
and so on...

Please note: in my case I may have 26 columns of data (Hence: this is why I couldn't use a nested if). I tried leveraging =INDEX(Range,MATCH(9.99999999999999E+307,Range)) but it that didn't work as the results is depended on the client name users pick from a drop down.

Any help on this is much appreciated!

Tarek
 
Last edited:

Some videos you may like

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

anglais428

Well-known Member
Joined
Nov 23, 2009
Messages
634
Office Version
  1. 2016
Platform
  1. Windows
=LOOKUP(9.99E+307,A2:Z2) will give you the right most numeric value in a range.
 

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,414
Maybe something like this


A
B
C
D
1
Client​
Data1​
Data2​
Data3​
2
ClientA​
6​
2​
4​
3
ClientB​
3​
4
ClientC​
5​
5
ClientD​
1​
4​
6
ClientE​
3​
7​
7
8
9
ClientA​
4​
10
ClientB​
3​
11
ClientC​
5​
12
ClientD​
4​
13
ClientE​
7​
14

Formula in B9 copied down
=LOOKUP(9.99E+307,INDEX($B$2:$D$6,MATCH(A9,$A$2:$A$6,0),0))

Hope this helps

M.
 

tarek

New Member
Joined
Nov 21, 2006
Messages
24
Thank you Anglais and Marcelo for your time and prompt response. We are on the right track, and apologies if I didn't translate my thoughts accurately. Looking at Marcelo's table, the scenario that I have is let us say that I only have a drop down list of clients name in cell A10, how can I have the formula reference A10 and bring the correct data based on user client selection from the list?

Thanks again for all the help on this.
 

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,414

ADVERTISEMENT

Thank you Anglais and Marcelo for your time and prompt response. We are on the right track, and apologies if I didn't translate my thoughts accurately. Looking at Marcelo's table, the scenario that I have is let us say that I only have a drop down list of clients name in cell A10, how can I have the formula reference A10 and bring the correct data based on user client selection from the list?

Thanks again for all the help on this.

Try

=LOOKUP(9.99E+307,INDEX($B$2:$D$6,MATCH(A10,$A$2:$A$6,0),0))

M.
 

tarek

New Member
Joined
Nov 21, 2006
Messages
24
Great (Que Otimo)! Thank you Marcelo :)
This resolved my issue.
 

Patrik_T

New Member
Joined
Sep 25, 2015
Messages
2

ADVERTISEMENT

Great Info, but does someone know how you could do the same thing but with text instead of numbers?

Much appreciated
 

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,414
Great Info, but does someone know how you could do the same thing but with text instead of numbers?

Much appreciated

Welcome to Mr Excel

Try this
=LOOKUP(REPT("z",255),INDEX($B$2:$D$6,MATCH(A9,$A$2:$A$6,0),0))

Hope this helps

M.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,517
Messages
5,602,120
Members
414,505
Latest member
quoctrungvu99

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
Top