Check if row values in column cannot be found in another range

TropicalMagic

New Member
Joined
Jun 19, 2021
Messages
47
Office Version
  1. 365
Platform
  1. Windows
Hi all,


I would like to:


Check if row values in Column AP cannot be found in another workbook's Range("D2:D31"), return "NULL" in Column AO

Else, return row values in corresponding row of Column AN in Column AO


I'm not sure how to create a formula which would find row values which do not exist in a range...


Many thanks!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Is this what you mean?
I have done this in a single sheet but it can be adapted to look in another worksheet/workbook. Post back with more details if you need more help with the adaptation or if I have not interpreted correctly what you want.

Sample data and expected results with XL2BB usually help clarify the requirement(s).

22 03 04.xlsm
DEAMANAOAP
1
2akNULLx
3bmmd
4cjNULLq
5dhNULLw
6ennb
7bbd
8xxe
9
Check other column
Cell Formulas
RangeFormula
AO2:AO8AO2=IF(ISNUMBER(MATCH(AP2,D$2:D$31,0)),AN2,"NULL")
 
Upvote 0
Is this what you mean?
I have done this in a single sheet but it can be adapted to look in another worksheet/workbook. Post back with more details if you need more help with the adaptation or if I have not interpreted correctly what you want.

Sample data and expected results with XL2BB usually help clarify the requirement(s).

22 03 04.xlsm
DEAMANAOAP
1
2akNULLx
3bmmd
4cjNULLq
5dhNULLw
6ennb
7bbd
8xxe
9
Check other column
Cell Formulas
RangeFormula
AO2:AO8AO2=IF(ISNUMBER(MATCH(AP2,D$2:D$31,0)),AN2,"NULL")

Hi, thanks for your response! Appreciate the sample workbook layout provided!


However, I decided to create more columns instead of confining the output to a single column,

ORIG_COUNTRY column row values may not be in the Range("D2:D31") despite having "APAC" ORIG_REGION column row value.

Hence, I included a new column, ORIG_COUNTRY_IN_LOCATION_LIST? =IF(COUNTIF(LOCATION'!$D$2:$D$31,AS2),"Y","N") to check if ORIG_COUNTRY column row values are in the Range("D2:D31").

Next, I created a new column, ORIG_COUNTRY_APAC REGION_BUT_NOT_IN_LIST =IF(AND(AN2="APAC",AO2="N"),"NULL","FALSE") to check if both the ORIG_REGION = "APAC" and ORIG_COUNTRY_IN_LOCATION_LIST? = "N"

Those row values with "NULL" means the ORIG_REGION row value = "APAC" but ORIG_COUNTRY row value is not of "APAC" ORIG_REGION (Wrong information)

Finally, I created a new column, FINAL_ORIG_REGION =IF(AP2="FALSE",AN2,"NULL") to output row values as "NULL" if corresponding row values ORIG_REGION = "APAC" and ORIG_COUNTRY_IN_LOCATION_LIST? = "N", correcting the wrong information


Many thanks and hope this helps!


You can refer to the screenshot's final 2 rows for more clarification.
 

Attachments

  • SCREENSHOT.png
    SCREENSHOT.png
    18.2 KB · Views: 5
Upvote 0

Forum statistics

Threads
1,215,500
Messages
6,125,166
Members
449,210
Latest member
grifaz

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top