Multiple IF Formula to Calculate Value or End in Zero

ScottTemple

Board Regular
Joined
Dec 28, 2023
Messages
103
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have the following formula in cell Q2:

=IF(ISBLANK(F2),"",IF(ISBLANK(P2),"",IF(ISBLANK(K2),"",(((F2*4)/3.14)/(P2*(K2^2)))/12)))

What I would like to add, is that if cell Z2 equals "RE-SPOOL" the formula returns a zero value, otherwise, return the value listed as part of the original formula.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Maybe adding an additional if statement at the beginning of your existing formula(Untested)

VBA Code:
=IF(Z2="RE-SPOOL",0,IF(ISBLANK(F2),"",IF(ISBLANK(P2),"",IF(ISBLANK(K2),"",(((F2*4)/3.14)/(P2*(K2^2)))/12))))
 
Upvote 0
Thanks Coyotex3, however, I'm hoping you can assist me with a follow up change to another formula that is impacted by this one.

In cell S2 I need to change the formula from =IF(Q2="","",IF(I2="","",(Q2/I2))) to something along the lines of =IF(Q2="","",IF(I2="","",(Q2/((F2*4)/3.14)/(P2*(K2^2))/12))). Where Q2 needs to be divided by the result of ((F2*4)/3.14)/(P2*(K2^2))/12
 
Upvote 0
Hi Scott, this is a different question. I can try to assist but are you able to share a sample of your data with made up data along with the desired result?
 
Upvote 0
Of course. The formula you provided changes column Q to equal zero if 'repolish' is entered into column Z.

Column S (standard run time) is calculated based on Q (footage) divided by I (line speed) - =IF(Q2="","",IF(I2="","",(Q2/I2)))

Column T (variance) calculates the difference between R (actual run time) minus S (standard run time). However, when Q shows 0, the value of T is not correct as we still need to calculate the different between the actual and standard run times (R-S). To get around this, I want to create a formula in S, which is normally =IF(Q2="","",IF(I2="","",(Q2/I2))), and changes the I2 to ((F2*4)/3.14)/(P2*(K2^2))/12 which is the calculation for Q. This will still give me a 0 value in Q, if Z equals respool, but will still calculate for S and provide the correct value for T.

1707333653914.png
 
Upvote 0
I'm somewhat following however, in this instance though, since Q2 is 0 based on "RE-SPOOL" being on cell Z2. Dividing Q2(0) by any number will give you a zero in column S. Isn't that so?

In the example that you shared, what should be displayed(result) in S2 and S3?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,097
Messages
6,123,076
Members
449,094
Latest member
mystic19

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