Return any customized text for the highest value in a column

alonc1983

New Member
Joined
Nov 6, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
How to return a value with any text for a highest value in a column and if it is equal to a certain text in another column.

Example.
If column A is equals to ABC and if column B is of highest value, then I can customize the value to be displayed
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Are you looking for something like this?
Excel Formula:
=MAX(IF($A:$A="ABC",$B:$B))
 
Upvote 0
So it is going to be like this...

Reason for updateDocument StatusSite CodeSystem CodeSub System CodeDoc TypeSequence numberRevisionDocument Number
CANCELLEDCLD2000102DTL0000100200-01-02-DTL-00001_R00
SUPERSEDEDAFC2010102DTL0000200201-01-02-DTL-00002_R00
SUPERSEDEDAFC2010102DTL0000201201-01-02-DTL-00002_R01
NEWAFC2010102DTL0000202201-01-02-DTL-00002_R02
CANCELLEDCLD2010102DTL0000300200-01-02-DTL-00001_R00
Please complete FormulaAFC2020102DTL0000400Please complete Formula
Please complete FormulaAFC2020102DTL0000401Please complete Formula
Please complete FormulaAFC2020102DTL0000402Please complete Formula
Please complete FormulaAFC2020102DTL0000403Please complete Formula
Please complete FormulaAFC2020102DTL0000404Please complete Formula
Please complete FormulaAFC2020102DTL0000405Please complete Formula
Please complete FormulaAFC2020102DTL0000406Please complete Formula
Please complete FormulaAFC2020102DTL0000407Please complete Formula
Please complete FormulaAFC2020102DTL0000408Please complete Formula
Formula for AIf B = CLD and I= is any number, A will show "CANCELLED". If B = AFC and I is the last or only revision of the same document number, then A will show "NEW". If B = AFC and I is not the last or only revision of the same document number, then A will show "SUPERSEDED".
Formula for Ireference cell I2 for example.
 
Upvote 0
Column I is easy. Paste this formula to I2:
Excel Formula:
=TEXTJOIN("-",1,C2,TEXT(D2,"00"),TEXT(E2,"00"),F2,TEXT(G2,"00000")) &"_R"&TEXT(H2,"00")
Column A is quite tricky. Maybe there is a simpler solution. Paste this to A2:
Excel Formula:
=LET(i,INT($D$2:$D$15&$E$2:$E$15&$G$2:$G$15&$H$2:$H$15),IF(B2="CLD","CANCELED",IF(ROW()-1=MATCH(MAX(($B$2:$B$15=B2)*($C$2:$C$15=C2)*i),i,0),"NEW","SUPERSEEDED")))
 
Upvote 0
Column I is easy. Paste this formula to I2:
Excel Formula:
=TEXTJOIN("-",1,C2,TEXT(D2,"00"),TEXT(E2,"00"),F2,TEXT(G2,"00000")) &"_R"&TEXT(H2,"00")
Column A is quite tricky. Maybe there is a simpler solution. Paste this to A2:
Excel Formula:
=LET(i,INT($D$2:$D$15&$E$2:$E$15&$G$2:$G$15&$H$2:$H$15),IF(B2="CLD","CANCELED",IF(ROW()-1=MATCH(MAX(($B$2:$B$15=B2)*($C$2:$C$15=C2)*i),i,0),"NEW","SUPERSEEDED")))
Thanks a lot! This works really.
 
Upvote 0
Glad it did work! A more cosistent version could be:
Excel Formula:
=IF(B2="CLD","CANCELED",IF(INT($D$2&$E$2&$G$2&$H$2)=MAX(($B$2:$B$15=B2)*($C$2:$C$15=C2)*INT($D$2:$D$15&$E$2:$E$15&$G$2:$G$15&$H$2:$H$15)),"NEW","SUPERSEEDED"))
But both versions will work OK 👍
Could you please mark as answer if it worked? It was a hard one for me :)
 
Upvote 0
Glad it did work! A more cosistent version could be:
Excel Formula:
=IF(B2="CLD","CANCELED",IF(INT($D$2&$E$2&$G$2&$H$2)=MAX(($B$2:$B$15=B2)*($C$2:$C$15=C2)*INT($D$2:$D$15&$E$2:$E$15&$G$2:$G$15&$H$2:$H$15)),"NEW","SUPERSEEDED"))
But both versions will work OK 👍
Could you please mark as answer if it worked? It was a hard one for me :)
Yes, this one worked too and I used this instead as this is more simple to understand. Thank you brother 🤗
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,490
Members
448,967
Latest member
visheshkotha

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