Question

I have a table with some numbers stored as text (UPC codes, so I don't want to lose leading zeros). COUNTIF() recognizes matches just fine, but MATCH() doesn't work. Is there a reason why MATCH() can't handle numbers stored as text, or is this just a limitation I'll have to work around?

Was it helpful?

Solution

Functions like MATCH, VLOOKUP and HLOOKUP need to match data type (number or text) whereas COUNTIF/SUMIF make no distinction. Are you using MATCH to find the position or just to establish whether the value exists in your data?

If you have a numeric lookup value you can convert to text in the formula by using &"", e.g.

=MATCH(A1&"",B:B,0)

....or if it's a text lookup value which needs to match with numbers

=MATCH(A1+0,B:B,0)

OTHER TIPS

If you are looking for the word test for example in cell A2, type the following:

=MATCH(""&"test"&"",A2,0)

If this isn't working then try =Trim and =Clean to purify your column.

If =Trim and =Clean don't help, then just use the left 250 characters... (As the Match Formula may encounter a timeout/overflow after 250 characters.)

=Left(A2, 250)

If you are using names to refer to the ranges, once you have fixed the datatypes also redefine any names which refer to those ranges.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top