简体   繁体   中英

Get max value from alpha numeric column

I have an Excel sheet. In ID column, there are multiple IDs in column and contain one letter in start.

Now in cell B1 and B2 , I want to apply the Max Function which should get the maximum ID of t and h respectively.

The problem is when I Use MAX(--RIGHT(B5:B11,3)) , it only returns maximum number. But I want to show the maximum ID of t and h in those cells.

Please help me on this. I need any non-VBA solution.

This should do it:

B1: =MAX(IF(LEFT(B5:B11,1)="t",--RIGHT(B5:B11,3),0))
B2: =MAX(IF(LEFT(B5:B11,1)="h",--RIGHT(B5:B11,3),0))

Please note that it's an array formula. So you have to press Ctrl + Shift + Enter when leaving the formula bar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM