Variance with IF

jdg347

New Member
Joined
Jun 19, 2009
Messages
19
Hi! I have a problem with calculating the variance of 2 columns.

Column B has a list of values already in it and column A is empty. What I want to do is as a value has been entered in column A, I want to calculate the percent difference between columns A and B. BUT only the % difference between the total of values entered in A and their corresponding B value total, NOT the difference between whats been entered in A and ALL of B. I also need to know if the total of what is entered in A is currently above or below the corresponding value total entered in B (ie, + or - %).

I tried using an if with sum, but didn't have any sucess. Here is the syntax I tried.

=IF(qryCableRoutingSchedule!B:B<> "", IF(SUM(qryCableRoutingSchedule!R2:R351)>A2,(SUM(qryCableRoutingSchedule!R2:R351)-A2)/(SUM(qryCableRoutingSchedule!R2:R351)),-1*(SUM(qryCableRoutingSchedule!R2:R351)-A2)/(SUM(qryCableRoutingSchedule!R2:R351))),0)
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
To return the sum of B2:B11 where A2:A11 is not blank:

=SUMIF(A2:A11,"<>",B2:B11)

Hope that puts you on track.
 
Upvote 0
I tried withe a couple of cells.. this calculates the percent difference from values in A and their corresponding values in B

=(SUM(A2:A7)-SUMIF(A2:A7,">0",B2:B7))/SUMIF(A2:A7,">0",B2:B7)
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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