Power Query: search multiple columns against a list of values?

little ribbit

New Member
Joined
Feb 22, 2021
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
I am trying to move an excel SUMPRODUCT function into Power Query.
The function searches a column against a list of names in a table, then returns TRUE if one is found.
Code sample:
IF ( SUMPRODUCT ( ISNUMBER ( SEARCH ( Table[Column], [@[current_field]] ) ) * ROW ( $rows included in Table[Column] ) ) >0, TRUE, FALSE )

There are seven (7) columns to check for each record so I put all of the separate SUMPRODUCT functions within an OR ( ) clause.
IF ( OR ( SUMPRODUCT ( ISNUMBER ( SEARCH ( Table[Column], [@[first_field]] ) ) * ROW ( $rows included in Table[Column] ) ) >0,
SUMPRODUCT ( ISNUMBER ( SEARCH ( Table[Column], [@[second_field]] ) ) * ROW ( $rows included in Table[Column] ) ) >0,
...
SUMPRODUCT ( ISNUMBER ( SEARCH ( Table[Column], [@[seventh_field]] ) ) * ROW ( $rows included in Table[Column] ) ) >0), TRUE, FALSE )

Does Power Query have an analogous function or functionality to accomplish this task?

Background: The report collects data in Excel then links to Access for table joins and processing.
I need to see if I can move this very manual report out of Access and completely into Excel.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I’m sure you can move from Access to Power Query/Excel, but I doubt you will find the solution if you try to find a similar function. Power Query is very different to Excel and hence it solves problems in different ways. It is better to explain your source data and the output you need and see if someone can help with a suggested approach.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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