Filling Empty Cells in Gross Annual Salary Column

INN

Board Regular
Joined
Feb 3, 2021
Messages
123
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a table with three columns: Country, Annual Salary, and Gross Annual Salary. Some cells under the Gross Annual Salary column are empty. How can I fill these cells with the same values as those in the Annual Salary column? using power Q. Thank you.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Simple way is to add a new calculated column using something like:

Power Query:
=if [Gross Annual Salary] = null then [Annual Salary] else [Gross Annual Salary]

then remove the original Gross Annual Salary column.
 
  • Like
Reactions: INN
Upvote 0
Simple way is to add a new calculated column using something like:

Power Query:
=if [Gross Annual Salary] = null then [Annual Salary] else [Gross Annual Salary]

then remove the original Gross Annual Salary column.
I'd update to
Power Query:
=if [Gross Annual Salary] = null or [Gross Annual Salary] = "" then [Annual Salary] else [Gross Annual Salary]
in case it isn't truly null.
 
  • Like
Reactions: INN
Upvote 0
Thank you all, can that be done without writing M language code? Thank you again.
 
Upvote 0
Not really, why? Anything you do in PQ is using M code.
 
  • Like
Reactions: INN
Upvote 0
I mean...a Find and Replace in your data prior to refreshing your queries, but that is too manual for my taste.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

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