简体   繁体   中英

Excel Cell value based on VLookup

I have my sheet like below
在此处输入图片说明

I need to automatically fille the ones in Red based on the look up value created in another sheet of same workbook. the lookup list is as below:
在此处输入图片说明

if it is under partner - it should show as partner, and if there is no value in lookup list , it can return "unknown" as default.

Any idea on how to get this done?

You can achieve this using a formula in your Company Type column.

Assuming the sheet containing the lookup data is called "data", and partners are listed in column A and competitors in column B. If you're trying to get the company type for the company in cell A2:

=IF(COUNTIF('Data'!$A:$A,A2)>0,"Partner",IF(COUNTIF('Data'!$B:$B,A2)>0,"Competitor","Unknown"))

Briefly:

COUNTIF('Data'!$A:$A,A2)>0

Counts all occurences that match the company name in A2 in the list of partner companys in column A of the Data sheet. If there is more than 0, this code block will return TRUE. This is then used to guide if statements determining the company type.

Using this example company data , I produced the lookup results shown . Hopefully this is what you're after.

Regards,

Xeozim

Edit: switched to COUNTIF for a simpler check

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM