I have a table, one column with emails, the one next to it with serial numbers.
I want to find the maximum serial number value for every email using this formula.
=TEXT(MAX(IF($A$1:$A$100=A4, MID($B$1:$B$100, 5, 5)+0)), "\VUAM00000")
to achieve something like this

I keep getting error #value! , after chasing my tail for so long I observed something really strange.. the formula works , as long as the serial does not have the letter "M" or apparently "N" too!!
so =TEXT(MAX(IF($A$1:$A$100=A4, MID($B$1:$B$100, 5, 5)+0)), "\VUA**X**00000") works!
also =TEXT(MAX(IF($A$1:$A$100=A4, MID($B$1:$B$100, 5, 5)+0)), "\VUA**T**00000") works
=TEXT(MAX(IF($A$1:$A$100=A4, MID($B$1:$B$100, 5, 5)+0)), "\VUA**M**00000") does not work
=TEXT(MAX(IF($A$1:$A$100=A4, MID($B$1:$B$100, 5, 5)+0)), "\VUA**N**00000") does not work either , but i don't care really i just found it weird that excel does not like these 2 letters.
so my question is, why is the formula working with some letters and some not , and how do i get it to work
note, i can't change the convention, its auto generated and has to be VUAM
I pretty much know it's the letter "M" that's causing the issue, i have tried using Right instead of Mid, with same result #value!
=TEXT(MAX(IF($A$1:$A$100=K3, RIGHT($B$1:$B$100, 5)+0)), "\VUAM00000")
also simplifying the formula to
=MAX(IF($A$1:$A$100=K3, RIGHT($B$1:$B$100, 5)+0))
works too ,or does its respective job in the formula, so the max part is fine , its when you add the rest the error occurs.
You could try using the following formulas, this assumes there is no
Excel Constraintsas per the tags posted:Or, using the following:
Or, you could use the following as well using
XLOOKUP()&SORTBY():§ Notes On
Escape Characters: The use ofbackslashbefore & after theV,U,A&Mis anescape character. Because theV,U,A&Mon its own serves a different purpose, we are escaping it meaning hence asking Excel toliterally form textwith that character.Here is the
Quick Fixto yourexisting formula, escape characters are not placed correctly, info on the same refer§One more alternative way using
SORT()&REPT()withImplicit Intersection Operator@Notes on
Implicit Intersection Operator@ : It helps in reducing many values to asingle value. 1.) If the value is a single item, then return the item, 2.) If the value is a range, then return the value from the cell on the same row or column as the formula., 3.) If the value is an array, then pick the top-left value. --> Excerpts taken fromMSFTDocumentations, read here.