Forum Discussion
Amlesh7400
May 03, 2021Copper Contributor
Find Common Values In ALL 5 Columns With Array Formulas
Hello, I have test data of 101 rows containing 3 or 4 Alphabet symbols in 5 columns. Some of these 3 or 4 letter symbols can be found across all 5 columns though not in the same row e.g. "BDRY" can...
- May 03, 2021
Amlesh7400 Perhaps easiest with Power Query. In the attached workbook you'll find a sheet called "Count". I trust you can do your analysis from there.
Riny_van_Eekelen
May 03, 2021Platinum Contributor
Amlesh7400 Perhaps easiest with Power Query. In the attached workbook you'll find a sheet called "Count". I trust you can do your analysis from there.
- Paul_SheppardJan 15, 2023Copper Contributor
Hi Riny
I found the test data file you produced for Amlesh and it is almost the perfect solution for something I am trying to do, but I only have data in 3 columns
I have never used Power Query until a couple of hours ago, but have managed to reduce the table on the Data sheet to 3 columns and on the Count sheet to 5, to match my needs
I have changed the Column Names on columns c to E on the Count Sheet but cannot change the names of the Columns on the Data sheet, when I do change them I get an error message [Expression.Error]The column '5-Day' of the table wasn't found
How do I change the Column Names without getting this error?
- Riny_van_EekelenJan 15, 2023Platinum Contributor
Paul_Sheppard Welcome to the "World of PQ".
Changing the column headers in the Count sheet is meaningless as a Refresh will use the headers that PQ finds in the Data table.
Change the column names in the Data sheet, and make some small adjustments to the query.
After the "Promoted Headers" step you see whatever column names you have given. The next step inserts a sum of a number of columns who's names are hard-coded in the query. And in the next step these columns are reordered, again with the hard-coded column names.
This query was in fact a bit sloppy but it worked at the time.
You can delete these last two steps and create your own Count. Select the columns you want to sum, and on the Add Column tab press this icon
PQ will automatically generate the correct code with the correct column names. Next, drag the columns in place to reorder them. Same thing het. The code is written automatically,
See if you can get it to work.
This site will help you get to grips with PQ, by the way.
https://exceloffthegrid.com/power-query-introduction/
- Paul_SheppardJan 15, 2023Copper Contributor
Hi Riny
Thanks for the pointer, now got it to work, just wanted more meaningful headers, that other users would understand
Will have a good look at the site you recommended, in some free time during the week
Once again thanks
Paul
- Amlesh7400May 05, 2021Copper ContributorRiny_van_Eekelen Thank you very much. if possible, can you share the Power Query so i can output a new excel file anytime the cell values change?
Regards,- Riny_van_EekelenMay 05, 2021Platinum Contributor
Amlesh7400 Well, the query that generates the table is in the file that is attached to my previous post. Depending on your Excel version you may have a separate Power Query tab/ribbon or you'll find the tools needed on the Data ribbon under "Get & Transform Data".
The steps applied to achieve the output aren't very complicated, that is, if you are familiar with Power Query. Otherwise you may get lost in all the options and icons.
- Amlesh7400May 05, 2021Copper Contributor
I have got the latest version of Excel for 365 subscription but don't know much about Power Query so thanks for the tip to help explore to refine my skills.
btw I stumbled upon a simpler formula using conditional formatting > highlight cell rules > use a formula to determine which cells to format
=COUNTIF($A$2:$E$101,A2)>4
Output is highlighted in chosen cell colour.