Finding Largest value

skittlz

New Member
Joined
Oct 26, 2012
Messages
35
Office Version
  1. 365
Platform
  1. Windows
I have "Asset ID" in Column A, and "Unit ID" in Column B.

See Image of sample data below.

1726843102252.png


I need to find the largest unit ID for a given Asset.

I found:

MaxSN = Application.WorksheetFunction.Max(Range("B:B"))

But this only works if there are numbers - the SN messes it up. I tried using OnlyDigits function to get just the numbers, but that didn't work.

I also need the MaxSN for the specific Asset = for example, E-027 should result in "3", E-017 should result in 10, and so on.

How do i get the Largest SN for a specified Asset?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Try:

Libro1
ABCDE
1Asset IDUnit ID
2E-017SN001E-01710
3E-017SN010E-0273
4E-017SN002
5E-017SN003
6E-027SN02
7E-027SN003
Hoja2
Cell Formulas
RangeFormula
E2:E3E2=MAX(($A$2:$A$7=D2)*(SUBSTITUTE($B$2:$B$7,"SN","")))
Press CTRL+SHIFT+ENTER to enter array formulas.


In excel 365, it is not necessary to enter the formula with CTRL+SHIFT+ENTER
 
Upvote 0
If you are including a larger range, where there may be empty cells or in column B they do not have the prefix "SN":

Excel Formula:
=MAX(IFERROR(($A$2:$A$100=D3)*(SUSTITUIR($B$2:$B$100,"SN",0)),0))


🤗
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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