Forum

Two If Not Conditio...
 
Notifications
Clear all

Two If Not Conditions in Power Query

3 Posts
2 Users
0 Reactions
107 Views
(@lt-cmdr-data)
Posts: 4
Active Member
Topic starter
 

In Power Query I am trying to check two different zip code columns for certain conditions. I want to check each column to see if they contain one of four zip codes. If either column contains any of the four zip codes, then I want one result but if neither column contains any of the four, I want a different result returned. Here is a sample of the M code I tried:

if [Origin Zip] <> "37167" or [Origin Zip] <> "43228" or [Origin Zip] <> "76118" or [Origin Zip] <> "92518"
and [Dest Zip] <> "37167" or [Dest Zip] <> "43228" or [Dest Zip] <> "76118" or [Dest Zip] <> "92518"
then "DS"

else "RS"

Perhaps I need to go about this a different way but I am stuck, probably because of the two negative conditions. Can anyone please help? Thank you in advance.

 
Posted : 09/01/2024 10:14 am
Alan Sidman
(@alansidman)
Posts: 223
Member Moderator
(@lt-cmdr-data)
Posts: 4
Active Member
Topic starter
 

This has been resolved at https://www.mrexcel.com/board/.....st-6141681

 
Posted : 10/01/2024 10:52 am
Share: