2 Replies Latest reply on Sep 24, 2018 2:03 PM by Thanushree Sampangi Pushpa

# get the difference of the number in the Same column with different conditions

In the attached Excel I have 4 columns  Tech,MiscID, Total mins, Actual mins. What I'm trying to populate is the Actual mins column which is calculated by taking the difference of the Total mins based on hte consition MiscID.

For example:-

For tech #3

miscId =0  Total mins = 476

MiscID <> 0 Total Mins= 59

I'm trying to populate a new column with the difference of these two Total mins which is 476-59 = 417.

I tried  (if [Misc ID] =0 then [Total mins] Else 0 end ) - (if [Misc ID]<>0 then [Total mins] else 0 end)

in the calculated field but it just duplicates the total mins. Any help is appreciated.

• ###### 1. Re: get the difference of the number in the Same column with different conditions

See the below calculation

sum(if [Misc ID] = 0 then [Total Mins] Else 0 end) - sum(if [Misc ID] <> 0 then [Total Mins] else 0 end)

• ###### 2. Re: get the difference of the number in the Same column with different conditions

Wow..!!

That's such a simple calculation.!!I   couldn't believe I tried everything else . Rookie mistake..!!

Thank you so much Alex. It worked perfectly.