Formula for Budget

S

Sarah

I need a formula for a budget I am drafting with estimated and actual costs.
Column B is estimated costs, Column C is actual costs. I can SUM the numbers
in Column B for the estimated total cost but for the actual total cost I need
to SUM the numbers in Column B unless there is a number in Column C that is
different, in which case I would like to use the value in C for that item
instead of B.

I am Excel illiterate so thanks for any help!
 
B

Bob Phillips

=SUM(IF(B2:B20<>C2:C20,C2:C20,B2:B20))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.
Excel will automatically enclose the formula in braces (curly brackets), do
not try to do this manually.
When editing the formula, it must again be array-entered.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
M

Mike H

Maybe

=SUMPRODUCT((B1:B100<>C1:C100)*(C1:C100))+SUMPRODUCT((B1:B100=C1:C100)*(B1:B100))

Mike
 
M

Mike H

my previous (poor) effort works but this is better

=SUMPRODUCT((B1:B100<>C1:C100)*(C1:C100))+(B1:B100=C1:C100)*(B1:B100)

Mike
 
A

Adrian M

Sarah said:
I need a formula for a budget I am drafting with estimated and actual costs.
Column B is estimated costs, Column C is actual costs. I can SUM the numbers
in Column B for the estimated total cost but for the actual total cost I need
to SUM the numbers in Column B unless there is a number in Column C that is
different, in which case I would like to use the value in C for that item
instead of B.

I am Excel illiterate so thanks for any help!
 
A

Adrian M

=SUM(B1:B100)-SUMIF(C1:C100,">0",B1:B100)+SUM(C1:C100)

the above range formula will work if you have blank cells in column C

hold down control and shift and then press enter to enter a range formula
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

summing two columns of different data 4
Budget Question 3
formula question 1
Report parameters 10
If formulations 2
sumproduct or sumif? 3
Formula for budgets 2
Graphical Indicator to show if outside budget 5

Top