Get MAX value of column, where value has to be extracted first

mrdoe

New Member
Joined
Feb 9, 2023
Messages
4
Office Version
  1. 2019
Platform
  1. Windows
Is there a way to get the max value in a column, where the actual number has to be extracted first (e.g. with LEFT())?
I want to get the max value for those lines where the initial character is Y for example:

X10
X14
Y21
Y23
Y4

I tried the following formula, but it doesn't work. It looks like it uses just the same row as the formula was entered and not the complete column range. The problem seems to be that LEFT and MID don't support ranges as input. I want to avoid having a separate column(s) just to prepare the input for the MAX function.
=MAX(VALUE(IF(LEFT(A:A;1)="Y";MID(A:A;2;10))))
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Thanks for that. (y)
How about
Fluff.xlsm
AB
1
2X1023
3X14
4Y21
5Y23
6Y4
Lists
Cell Formulas
RangeFormula
B2B2=MAX(IF(LEFT(A2:A6)="Y",MID(A2:A6,2,100)+0,0))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
ok that would work, but it stills needs another column, right? I would like to have the max value in the one of header texts. In your example I couldn't move the formular from B2 to A1 for example.
 
Upvote 0
It can go in A1
Fluff.xlsm
A
123
2X10
3X14
4Y21
5Y23
6Y4
7
Lists
Cell Formulas
RangeFormula
A1A1=MAX(IF(LEFT(A2:A6)="Y",MID(A2:A6,2,100)+0,0))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Thanks a lot, that worked. Don't know what I did differently last time I tried, probably forgot CTRL+SHIFT+ENTER.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,822
Messages
6,121,765
Members
449,049
Latest member
greyangel23

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