Filling Empty Cells in Gross Annual Salary Column

INN

Board Regular
Joined
Feb 3, 2021
Messages
124
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

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
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,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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