Forum Discussion
Nick_L1025
Mar 23, 2023Copper Contributor
Fill blank cells with values from a cell beside it (not merge)
Hi everyone,
Is there an easy way that excel can help fill in blanks efficiently if there are multiple columns that might have similar data and you want bring multiple columns together into one.
Please see the example below.
Product ID | ID of Product |
4324242 | 4324242 |
3242342 | 64564 |
453 | |
43543 | |
435 | |
432424 | |
345 | |
5453453 | |
4234234 | |
53453543 | |
5345435 | |
423432423 | |
534543 | |
453453 | |
423 | |
45435 | |
42 | 534534 |
As you can see, there's 2 columns that I want to merge into one, but some of them have information in BOTH columns, in that case I'd want to prioritize one column over another (not concatenate or merge them with a separator.
The Master column, let's call it, should have only 1 product ID.
How could I do this, and if that is possible, how can I do it with more than 2 columns.
Also, can I do this within power query editor?
Thanks so much
- NikolinoDEGold Contributor
My knowledge of PQ is limited (to put it mildly :), but I was able to find this solution proposal on the internet.
Power Query Editor by using the Table.ReplaceValue function.
For example, you can use this code:
= Table.ReplaceValue(#“Changed Type”,null,[ID of Product],Replacer.ReplaceValue,{“Product ID”})
This will replace any null values in the Product ID column with the values from the ID of Product column.
I hope this helps.