Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9786

How to categorize data according to the first n characters of its number?

$
0
0

Sorry for the confusing title, my problem is this:

I have a table of items, like this:

ABC
1NumberNameCategory
2100-150-135Mike-
3150-150-133Joe-

In the same document, I have another sheet that looks like this:

AB
1NumberCategory
21001
31502

I want the first table to check the first three characters of a number, look up the corresponding category in the second table and write that category into the third column. So "Mike" should have category 1 and "Joe" should have category 2.

I tried to do it by extracting the first three characters using LEFTB and then using IFS like so:

=IFS((=LEFTB(A:A;3))=Sheet2!A:A ; Sheet2!B:B)

Gives me an error Formula parse error . I tried to do something similar with SWITCH but that didn't work either. I have never worked with Sheets before, so any help would be highly appreciated.


Viewing all articles
Browse latest Browse all 9786

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>