Find a value (and its left cell value) in another spreadsheet similar to my current value

0

I have a problem regarding Google spreadsheets. I'm not very experienced in google spreadsheets but I know some basics.

My problem is: I have google spreadsheet document with two sheets called categories and usages.

Categories:

Sheet categories]

Usages:

Sheet usages]

In the categories sheet I have two columns with main category and sub category. There are many sub categories which belong to the same main categories and therefore I have ~ 15 sub categories and ~ 3 main categories.

In the other sheet I want to write down usages of each sub category. Next to the selected sub category should be the main category automatically. I can select the sub category via data-validation. The only thing (ha!) I want to have is to find out which main category belongs to the selected sub category.

I imagine something like "look for sub category x in categories sheet and find the value right next of it and write it here".

How can I find a value (and its left cell value) in another spreadsheet similar to my current value?

matthiaskurte

Posted 2019-07-17T08:02:34.967

Reputation: 1

Answers

0

I already found the answer by myself. The magic function is LOOKUP.

In this case I added a this (in row 2):

=LOOKUP($B2; categories!$B$1:$B$20; categories!$A$1:$A$20)

I've also added an IF statement, if the subcategory is empty:

=IF(COUNTA($B2);LOOKUP($B2; categories!$B$1:$B$20; categories!$A$1:$A$20);)

matthiaskurte

Posted 2019-07-17T08:02:34.967

Reputation: 1