VBA Code to find max value from horizontal text from list having numbers

jackt05

Board Regular
Joined
Feb 1, 2009
Messages
194
Dear All,

I have the following names in a row like below


SamJohnJackGeorge PaulMathew Joy

<tbody>
</tbody>



and I have a table on another sheet where I have the following data,

<!-- Please do not remove this header -->


Sam45
John60
Jack30
George Paul85
Mathew Joy32

<tbody>
</tbody>


As a result in the next column cell I need the name of the highest aged person and in next column cell his age.

as in this case

George Paul85

<tbody>
</tbody>




There is around 2000 rows everyday and Presently I am doing it manually.

If I get a VBA code it would save me a lot of work.

Thanks in Advance

Jack
 
I have shared the sheet to a colleague but he has office 2007. and aggregate function is not working in that office is there any other solution.
Sure. These are array formulas so should be entered without the {} but confirmed with Ctrl+Shift+Enter, not just Enter. If confirmed correctly, Excel will insert the {}. The formula can then be copied down.

Excel Workbook
ABCDEFGHI
1ResultResult
2Name 6Name 2Name 5Name 8Name 7Name 762
3Name 9Name 10Name 15Name 17Name 1Name 1071
4Name 4Name 11Name 16Name 13Name 3Name 369
Sheet3
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Got It,

First did not properly enter.

But got the trick of confirming.

Thanks a lot
 
Last edited:
Upvote 0
Dear Peter,

It is just returning the original list from top to bottom. not the names and "0" for Age.

I have used it as array.

what can be the error in entering.
I'm not sure. You can see that it is working for me. Here is my KM sheet with values entered in column B as Text, which is apparently what you had earlier.

Excel Workbook
AB
1NameAge
2Name 132
3Name 258
4Name 369
5Name 445
6Name 520
7Name 619
8Name 762
9Name 850
10Name 940
11Name 1071
12Name 1133
13Name 1230
14Name 1328
15Name 1441
16Name 1518
17Name 1655
18Name 1717
19
KM



Has your data format changed?

In sheet KM, what does this formula, placed in an empty cell, return =ISNUMBER(B2)
 
Upvote 0
Sorry Peter,

I was not actually entering the formula properly,

Your formula is absolutely correct.

Thanks very much for your support.

Jack
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,605
Members
449,089
Latest member
Motoracer88

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