Column Subtraction

sadath

Active Member
Joined
Oct 10, 2004
Messages
262
Office Version
  1. 365
Platform
  1. Windows
Hi,

I am trying to put a custom column by subtracting Value1 from Value2, Subtraction column is the result i got from PQ
Store3 result should be -21 (null-21) & Store 5 result should be 54 (54-null). How can get the correct result

Store Value1 Value2 Subtraction
Store 1 1700 3544 1844
Store 2 6464 2432 -4032
Store 3 21
Store 4 64 312 248
Store 5 54
Store 6 213
Store 7 654 1231 577
Store 8 56 2 -54
Store 9 3
Store 10 564 312 -252
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi sady,
Hope your doing good!

if your look for Formula to do that please try with this formula "=IF((C3-B3)>0,(C3-B3),ABS((C3-B3))&" - null")"

Thanks!
LET
 
Upvote 0
Hi
I wrote in my thread, its PQ (Power Query) not excel formula. And this section is only for Power BI

any one have the answer
 
Upvote 0
Nulls aren't the same as 0. A + null = null, a - null = null etc etc

Duplicated your columns for value 1 and value 2. Replace values null --> 0 and then do the subtraction. Delete the two helper columns.
 
Upvote 0

Forum statistics

Threads
1,214,813
Messages
6,121,705
Members
449,048
Latest member
81jamesacct

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