Power Query, if(AND) equivalent?

cr731

Well-known Member
Joined
Sep 17, 2010
Messages
611
I'm trying to add a custom column in Power Query that tests two columns values at once. In Excel terms, something like,

IF(AND(Criteria1,Criteria2),true,false)

Can this be done in Power Query?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I am not aware of an AND option. You can nest 2 if statements....

if x then (if y then "both match" else "both don't match") else "both don't match

or assuming you are checking 2 columns, you could create a new concatenated column and test for the concatenated pair you are after
 
Upvote 0
you could also write it like this:

if Citeria1 and Criteriae then true else false

I prefer to use brackets in these cases:

if (Criteria1 and Criteria2) then true else false
 
Upvote 0

Forum statistics

Threads
1,224,151
Messages
6,176,707
Members
452,741
Latest member
MrCY

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