Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function for multiplying one column by another 1

Status
Not open for further replies.

malaize2

Technical User
Dec 22, 2004
69
0
0
US
I have an excel file with a prices listed in column A. I would like to easily calculate a list of the prices if they are discounted by 10%. I gave column A2 a name of Cost. I know that I can create a function in column B like this:

= Cost * 90%

What I don't know is how to have the function apply to every cell in the A column without having to manually clicking on each A cell and typing = Cost * 90%

Could someone please help me?

Thanks,

 
Hover the cursor over the bottom-right corner of the cell containing the formula until it changes to a bold plus sign (+).

You can now either drag down as far as needed or just double click and Excel will automatically fill down as far as the column to the left is populated.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
I think maybe the name "Cost" may present a problem. If the first price is in cell A2 put the following in B2:

=A2*.9

To extend it to the other cells in the B column do as anotherhiggins has suggested.
 
I like to keep the " markup or discount value" as a separate cell. This way you can change it whenever without having to change each cell formula.
In B1 I would place 90%.
My formula in B2 would be:
=if(or(a2="",a2=0,$b$1="",$b$1=0),"",a2*$b$1)
1. This will check to see that a proper value & discount are available, if not it will be blank.
2. It will multiply a2*b1 (where b1=90%)
3. Click on the formula cell (b2) and drag down to as many rows as needed. Example if you drag to b50, the formula in b50 will read:
=if(or(a50="",a50=0,$b1$1="",$b$1=0),"",a50*$b$1)
The $b$1 tells excel to take that unique cell value (location) only.

Regards
Peter Buitenhek
ProfitDeveloper.com
 
Thanks so much anotherhiggins. That worked perfectly. CBasicAsslember, I didn't assign the "Cost" name to my columns.

Thank you very much.

malaize2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top