Dividing a cell based on another cell

danjoles1

New Member
Joined
Jan 16, 2019
Messages
4
I am trying to write a formula to calculate cost per foot (cell E13)
I want the total in cell E12 to be divided by cell C8 if it has data if not move to cell C9, do this through C11.

ItemQuantityCostTotal
Corner post assembly890720
"H" assembly1056560
Wood line post21.880
T post8604.854171
Fiberglass post7.280
3 Strand electric0.090
3 Strand Barbless0.160
4 Strand Barb0.210
5 Strand Barb140000.263640
Total cost of material:9091
Matrerial cost per ft:

<tbody>
</tbody>
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I am trying to write a formula to calculate cost per foot (cell E13)

I want the total in cell E12 to be divided by cell C8 if it has data if not move to cell C9, do this through C11.

<tbody>
</tbody>

I am assuming you mean to say, if C8 has data?

Code:
=IFS($C$8<>"",$E$12/$C$8,$C$9<>"", $E$12/$C$9,$C$10<>"", $E$12/$C$10, $C$11<>"",$E$12/$C$11,)
 
Last edited:
Upvote 0
Well I tried that, and I removed spaces after the coma's and still receiving the name error. the code looks like this now...
=IFS($C$8<>"",$E$12/$C$8,$C$9<>"",$E$12/$C$9,$C$10<>"",$E$12/$C$10,$C$11<>"",$E$12/$C$11)
 
Upvote 0
The IFS function is not available for all excel versions, thus your error

You can convert it to nested IF functions (IF($C$8<>"",$E$12/$C$8, IF()) and so on
 
Upvote 0
The IFS function is not available for all excel versions, thus your error

You can convert it to nested IF functions (IF($C$8<>"",$E$12/$C$8, IF()) and so on

I have tried a couple different ways.

=(IF($C$8<>"",$E$12/$C$8,$C$9<>"",IF($E$12/$C$9,$C$10<>"",IF($E$12/$C$10,$C$11<>"",IF($E$12/$C$11)))))
=IF($C$8<>"",$E$12/$C$8,$C$9<>"",IF($E$12/$C$9,$C$10<>"",IF($E$12/$C$10,$C$11<>"",IF($E$12/$C$11))))
=IF($E$12/$C$8,$C$9<>"",IF($E$12/$C$9,$C$10<>"",IF($E$12/$C$10,$C$11<>"",IF($E$12/$C$11))))
=IF($C$8<>"",$E$12/$C$8,$C$9<>"",($E$12/$C$9,$C$10<>"",($E$12/$C$10,$C$11<>"",($E$12/$C$11))))
=IF($E$12/$C$8,$C$9<>"",($E$12/$C$9,$C$10<>"",($E$12/$C$10,$C$11<>"",($E$12/$C$11))))

Its not accepting these
 
Upvote 0
I don't want to give you the full formula as I don't think that will teach you how formulas work, and I don't think you're showing incentive to learn how they do..

When you type =IF() in the formula bar (or any other valid formula for that instance), you'll be able to open the Function Arguments window by clicking on the fx symbol left of the formula bar. Here you will be able to see and fill in all arguments for the formula.

For the IF() function, there are three arguments:
1. the logical test
2. the value if the logical test is true
3. the value if the logical test is false

So, IF(1=1, "a", "b") will return "a" because 1 is always equal to 1.

In your case you want to test whether cell C8 has a value. If it does, you want to divide E12 by that number. If it does not, you want to redo the IF() function for cell C9 (see the three arguments of the IF() function?). So, you end up with a nested IF() function.
 
Upvote 0
I am trying to write a formula to calculate cost per foot (cell E13)
I want the total in cell E12 to be divided by cell C8 if it has data if not move to cell C9, do this through C11.

<tbody>
</tbody>

Hi, if only one cell in C8 to C11 can ever be populated then you could simply use something like.


Excel 2013/2016
BCDE
2ItemQuantityCostTotal
3Corner post assembly890720
4H assembly1056560
5Wood line post21.880
6T post8604.854171
7Fiberglass post7.280
83 Strand electric0.090
93 Strand Barbless0.160
104 Strand Barb0.210
115 Strand Barb140000.263640
12Total cost of material:9091
13Matrerial cost per ft:0.649357
Sheet1
Cell Formulas
RangeFormula
E13=E12/SUM(C8:C11)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,298
Members
449,077
Latest member
Rkmenon

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