Sum

basia

New Member
Joined
Dec 18, 2014
Messages
4
1ABCD
2JanuaryFebruaryMarch
3 Accrual 1,075.00 980.00 1,050.00
4 Actual 1,040.30 979.52
5 Variance (34.70) (0.48) 1.10

<colgroup><col><col><col span="3"></colgroup><tbody>
</tbody>

In this example I need a formula that totals actual values (B4, C4) unless the actual value is blank in which case I need to add the accrual (March D3 in this example).

I would need this formula to apply the same way to each month. So if there is no actual value then using the accrual amount. Ex: If Feb actual is blank, total should equal January actual and Feb accrual.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
This might work - it sums everything in the Actual row, then adds the cells in the Accrual row when the Actual row below it is blank

Code:
=SUM(B3:D3)+SUMIF(B3:D3,"",B2:D2)
 
Upvote 0
not sure I've got this right, but does this work:

=SUMPRODUCT(--(LEN(B3:I3)=0),(B2:I2))+SUM(B3:I3)

It assumes you have additonal months after March but should work even if they're all blank.
 
Upvote 0
Maybe:
=SUM(B3:M3,INDEX(B2:M3,1,MATCH(9.99999999999999E+307,A3:M3)))

Assuming Jan through Dec in columns B through M.
 
Last edited:
Upvote 0
not sure I've got this right, but does this work:

=SUMPRODUCT(--(LEN(B3:I3)=0),(B2:I2))+SUM(B3:I3)

It assumes you have additonal months after March but should work even if they're all blank.


This worked!!! Thank you so much!!!!
 
Upvote 0
my pleasure, welcome to the forum and many thanks for the feedback.

Regards
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,462
Members
448,965
Latest member
grijken

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