If "0" Then Excel - excel-formula

I am trying to build a formula that does the following:
The main formula for cell S8 is SUM(S4:S7)+S119
but if cell S9 and S119 both equal 0 then I need cell S8 to display $0.00 and ignore the main formula.
Also, if S9 equals 0 but S119 is greater than 0 then compute the main formula
Here are a few formulas I've tried but never the results I need
=if(S119=0,SUM(S4:S7)+S119,if(S119>0,SUM(S4:S7)+S119,if(S9=0,"$0.00")))
and
=if((S119)>0,SUM(S4:S7)+S119,if(AND((S119)=0),(S9=0),"$0.00"))
I've also tried ISBLANK instead of AND but that didn't work either.... Any help would be greatly appreciated!!
I was using http://www.techonthenet.com/excel/formulas/if_nested.php as my example but can't seem to figure it out.

It sounds like you want to use the main formula as long as S9 and S119 are not both zero. If they are both zero, return 0.
=if( and(S9=0,S119=0), 0, sum(S4:S7) )
I do not think you want to hard-code the string "$0.00" but rather return 0 and format as currency.

Related

Trying to use indirect to make a formula dynamic

Ok, so I am trying to do something I thought was very simple, but it is turning out to be more complicated.
What I am trying to do:
Take a value through an if statement and return 1 or 0. But I want to be able to change the formula by changing values in cells and not editing the formula itself.
Example:
cell A1 = 41%
cell B1 = >
cell C1 = 40%
cell D1 = Formula with calculation
I want to create a formula that will tell me if that 41% is > than 40%, but if I change that > in B1 for a < (in a separate cell outside the cell with the formula) or I change C1 I want it to recalculate.
I have tried the following:
=IF(A1&B1&C1,1,0)
=IF(A1&INDIRECT(B1)&C1,1,0)
=IF(INDIRECT(A1)&INDIRECT(B1)&INDIRECT(C1),1,0)
all of these result in errors and I cannot figure out how to make it work. I am assuming it is taking the > and making it a string instead of a part of the formula.
Thanks for the help.
=COUNTIF( A1, B1&C1 )
... seems to do the trick, although converting C1 to text may give some rounding errors
An alternative would of course be to enumerate all the operations:
=--IFS( B1=">", A1>C1, B1="<", A1<C1 )
And add other operators as you come across them (NB the -- turns TRUE/FALSE into 1/0)

Excel If Functions with Multiple Conditions

I need to create a formula that captures the following information:
If the value in C3 is 0 it needs to read 'Green',
the value in C3 is ≥1 but <500 it needs to read 'Silver',
the value in C3 is ≥500 but <1500 it needs to read 'Gold' and
if the value in C3 is ≥1500 then it needs to read 'Platinum'.
I have this formula worked out:
=IF(D3<500,"Silver",IF(AND(D3>=500,D3<=1499),"Gold","Platinum"))
but I can't figure out how to incorporate the 0 to equal Green.
Thanks for your help in advance.
You can do:
=IF(C3<=0,"Green",IF(C3<500,"Silver",IF(C3<=1499,"Gold","Platinum")))
I added <=0 just in case you have negative numbers. Without it, -1 will return Silver. Also note that if C3 is empty/blank, it'll return Green still.

What is wrong with my formula

I have been working on an EXCEL formula and am stuck.
=If(B10<4, B10*0, If(B10>3 AND B10<8, B10*1, B10*2)))
I keep getting an error. Can someone tell me what is wrong with it.
What I am trying to do is say:
If B10 is Less than 4 Multiply the value of B10 by Zero
If B10 is Between 4 and 7 Multiply the value of B10 by 1
Else Multiply the Value of B10 by 2
AND, is AND(condition1,Conditon2) not condition1 AND Condtion2
=If(B10<4, B10*0, If(AND(B10>3, B10<8), B10*1, B10*2))
That being said you do not need the AND at all:
=If(B10<4, B10*0, If(B10<8, B10*1, B10*2)))
The second if will fire only if B10 >= 4 so the B10>3 is not needed.
And since anything multiplied by 0 is 0 you do not need the B10*0. And since anything multiplie by 1 is itself, you do not need the *1
=If(B10<4, 0, If(B10<8, B10, B10*2)))
Credit #BruceWayne.
Looks like you have one too many parentheses. should look something like
=If(B10<4, B10*0, If(AND(B10>3, B10<8), B10, B10*2)))
This formula takes the and statement and places it inside of the second If statement, checking to see if the cell B10 is greater than or equal to 4 and then checking to see if the cell B10 is both less than 8 or greater than 3.
Can be shortened to =B10*((B10>=4)+(B10>=8))

Excel: How ro write Mutiple IFs in in same formula and formula not pulling correct value?

I am having trouble with the formula below as it is not pulling the correct value or perhaps the formula needs to be tweaked.
=IF((AND(Sheet1!H10>65,D17>=65)),Sheet2!D$47,VLOOKUP(D17,Sheet2!$A$2:$K$51,4,FALSE))
What I am basically trying to do is if the value in H10 is greater than 65 and the value in D17 > or = 65 then pull the value from sheet2 D47 cell. Other wise use vlookup to lookup the value.
I have a case where The value in D17 =66 however, it is returning the value based on the vlookup and not Sheet2-D47.
Also, is it possible to have multiple IFs in the same formula?
Where are you writing the formula? If your formula isn't on sheet1 D17 might be pointing at the wrong cell. It sounds like it would be pointing to the correct D17 if your vlookup is working though. Remember with an AND formula, all conditions need to be true. Is H10>65? if not then even with D17 = 66 then if statement will return false and execute the vlookup.
And yes you can have nested if statements (I believe 7 is the most). but you can do:
=if(A5>5, if(A5 = 7, "A5 is greater than 5 and equals 7", "A5 is greater than
5, but does not equal 7"),"A5 is less than 5)

Excel Formula - IF & "X" > 0

I have a formula that I'm using in Excel to determine what the payback of a value is after "X" of months. But I'd like to modify the formula to display 0 or $0.00 if the result of the formula is less than $0.00
The current formula is
=C2-(C2*(G2/24))
But is there a way I can make this so once the value hits 0 or less than 0, it would simply display $0.00
Thanks,
For readability's sake you could also use:
=MAX(C2-(C2*(G2/24)),0)
That presents Excel with two options, the result of the formula or zero, and asks it to display the larger of the two.
You can use something like:
=IF(C2-(C2*(G2/24))>0,C2-(C2*(G2/24)),0)
to return a 0 result if the result would have otherwise been negative.

Resources