Need help with a SUM function!!

peshopesh

New Member
Joined
Oct 14, 2008
Messages
7
I have a budget spreadhseet which has a column for estimated spend, and a column for actual spend.

I have a SUM function set up to calculate the total 'actual spend' but if the actual is missing, I want the SUM function to refer to the 'estimated spend' column.

Is this possible, I have been looking into it for over a day now.

Any help would be greatly appreciated!

This is my first post so be gentle!

Pesh
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi Pesh

So your sum might be a combination of the two columns? Say you have data in A2:B5 (col A is actuals, B is Estimate) you could use this:

=SUMPRODUCT((A2:A5="")*B2:B5+(A2:A5< >"")*A2:A5)
 
Upvote 0
Welcome to the MrExcel board!

Is it really only 1 column of each, or do you have these two columns for each month maybe?

It would be very helpful if we could get a better idea of your layout and data. Would it be possible to post a small screen shot using one of the add-ins below and explain your requirements in relation to the screen shot?
Excel jeanie
or
Colo's HTML Maker
 
Upvote 0
WOW!

You guys are not only fast, but pretty good as well! Cheers Richard, that worked fine, and appears to be the right method. Is this possible to be made shorter or simplified?

Cheers Peter for your reply as well, I will use some of those add-ins in future. What are the best add-ins available for Excel, could you PM them to me if this is not the suitable place to discuss.

Pesh
 
Upvote 0
I guess you could use

=SUM(IF(A2:A5,A2:A5,B2:B5))

which is an array formula and so must be confirmed with Ctrl+Shift+Enter (Excel will surround with curly braces {} on successful entry - don't try and enter these manually yourself).
 
Upvote 0
.. or this non-array formula?
=SUM(A2:A5)+SUMIF(A2:A5,"",B2:B5)

Richard
I think that last one fails if there is an actual spend of 0 in a row.
 
Upvote 0

Forum statistics

Threads
1,215,004
Messages
6,122,656
Members
449,091
Latest member
peppernaut

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