# Looking for an If formula

#### Oakey

##### New Member
I am looking to use a IF formula but not sure how to write it so it returns the value i want.

I have a list of SKU's that have a location by them, i also have a separate list of locations. I want the If formula to return a value of 1, if the SKU's location appears in my 2nd list.

 ID SKU Product Location Type Current location 5379 rxi008 Black Record Album Frame High Volume Extra Large P1-AA003-B 8814 wdd004 Baby Keepsake Box with Drawers High Volume Extra Large P3-AA011-A 16389 ing005 50th Birthday Signature Numbers High Volume Extra Large P3-AB013-B 15997 ing001 18th Birthday Signature Numbers High Volume Extra Large #N/A 940 fun017 Inflatable Sumo Suit High Volume Extra Large P1-AA027-A 15998 ing002 21st Birthday Wooden Numbers and Pen High Volume Extra Large P2-AA026-C 18377 wlw006 Igloo Hedgehog Home High Volume Extra Large P1-AA003-A 20036 ing006 60th Birthday Signature Number High Volume Extra Large P1-AB041-D 16388 ing004 40th Birthday Wooden Numbers High Volume Extra Large #N/A 15999 ing003 30th Birthday Signature Numbers and Pen High Volume Extra Large #N/A 18387 luc126 Scratch Map Deluxe Edition High Volume Extra Large P2-AA005-B

<colgroup><col span="2"><col><col><col></colgroup><tbody>
</tbody>

### Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

#### tyija1995

##### Well-known Member
Hey,

Try something like this:

F2:
=IF(COUNTIF(Input_Your_Locations_List_Range_Here, E2)>0, 1, "")

Where E2 is the first "Current Location" value - change the locations list range to wherever that is to reference it. Then drag formula down the F column (Assuming data is in Cols A-E, change appropriately)

#### Oakey

##### New Member
That worked, thank you

1,129,316
Messages
5,635,521
Members
416,862
Latest member
MGDlite

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back