Link to home
Start Free TrialLog in
Avatar of morinia
moriniaFlag for United States of America

asked on

Assigning a value to Column B if Column a matches one of the values in my named field

Experts,

I have a group of values on a spreadsheet "Sheet 3"  Column A  Rows 2 =15 that I have assigned to a name field called 'East'.  Is there a way to check column "A" on Sheet 1 equal to one of the values in my named field and assign "EAST" to column "B' on the respective row.

Microsoft Excel 2016
Named_Feild.xlsx
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

can you post a sample so we can better understand your question?
=IF(OR(A2=East),"EAST","")

Open in new window

If you are an Office Insider running Excel 2016/Office 365, you have dynamic arrays and this is a regular formula. If not, it is an array formula and you must CTRL + Shift + Enter.
You may try this...

In B2
=IF(ISNUMBER(MATCH(A2,East,0)),"East","")

Open in new window

and then copy it down.
Named_Feild.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Shums Faruk
Shums Faruk
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@Shums

I agree. Countif would be the best approach in this scenario.
Though the formula can also be written as...

=IF(COUNTIF(East,A2),"EAST","")

Open in new window

In the above formula if Countif returns a count greater than zero, it would be considered as True.
Avatar of morinia

ASKER

Thanks to all the experts, This formula worked perfectly.
=IF(COUNTIF(East,A2)>=1,"EAST","")