# "multiply" IF

#### stan1986

##### New Member
I have two columns (A & B). Column A are forecasted prices and Column B are the actuals. In column C, I am summing the products of either column multiplied by one cell, which is the "unit count". I am summing all of column C to total the most approximate budget.

PROBLEM: I want each cell in column C to contain a formula that will multiple the "unit count" (one cell) by column B IF there is a number > 0 there. IF there is not, I want it to multiply the "unit count" (one cell) by column A.

Unit Count: 2

A B C
1 0 ????
3 5 ????
4 5 ????
5 6 ????
5 0 ????

I want a formula in column C that makes the ????'s 2,10,10,12,10 respectively. Column C would then total 44.

### Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Työkirja5
ABCD
1Unitcount2
2
3102
43510
54510
65612
75010
Taul1

PS. Welcome to the board!

Hi and welcome to the board!!!
Code:
``=IF(B2,B2*2,A2*2)``
Hint: If UC will vary, name a cell for it(Say UC) or maybe even a Named Formula(Insert>Name>Define, refers to =2). Now your formula would be
Code:
``=IF(B2,B2*UC,A2*UC)``
Either a named range or formula can be easily changed
lenze

stan1986,

Cell B1 is range name "UnitCount".

Excel Workbook
ABC
1Unit Count2
2
3102
43510
54510
65612
75010
844
Sheet1

The formula in cell C3 (copied down to C7):
=IF(B3=0,UnitCount*A3,UnitCount*B3)

Have a great day,
Stan

Last edited:
Thank you so much to everyone who responded. This is a great community that I'm now thrilled to be a part of. Not only did I get my question answered but I've gotten variations that have helped me expand my excel knowledge. Best of all, everyone seems really sweet. THANKS for the help and warm welcomes!

Replies
1
Views
636
Replies
3
Views
315
Replies
8
Views
537
Replies
2
Views
235
Replies
1
Views
98

1,196,048
Messages
6,013,089
Members
441,747
Latest member
darkman77

### 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.

### Which adblocker are you using?

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

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