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.
Related
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)
This array formula allows me to populate D4 by searching for the first non blank value in Column A (see link - https://exceljet.net/formula/get-first-non-blank-value-in-a-list)
=INDEX(A2:A1000,MATCH(FALSE,ISBLANK(A2:A1000),0))
However, I'd like to refine it such that the column being searched changes depending on the value entered in C4.
For example, if the value in C4 were 1 than I'd get the value 13.86. If the value in C4 were 2 I'd get the value 10. See here -
click for link to example data
I tried adapting the above array formula with an IF function but no success. I'm a total novice so be kind :)
=IF(C4=1,(INDEX(A2:A1000,MATCH(FALSE,ISBLANK(A2:A1000)))),IF(C4=1,(INDEX(B2:B1000,MATCH(FALSE,ISBLANK(B2:B1000)))),0))
In D5 as an array formula (with CSE),
=INDEX(A2:B1000, MATCH(FALSE, ISBLANK(INDEX(A2:B1000, 0, C4)),0), C4)
Okay. It is gonna look daunting but trust me if you look closely it really is a very simple combined with few other formulas
Enter the below formula in D4 or desired cell and press Ctrl+Shift+Enter
=INDEX(INDIRECT(SUBSTITUTE(ADDRESS(1,K4,4),"1","")&1&":"&SUBSTITUTE(ADDRESS(1,K4,4),"1","")&100),MATCH(FALSE,ISBLANK(INDIRECT(SUBSTITUTE(ADDRESS(1,K4,4),"1","")&1&":"&SUBSTITUTE(ADDRESS(1,K4,4),"1","")&100)),0))
Here K4 is my input cell(which is C4 for your case) and I have considered a range of 1:100 unlike yours of 1:1000. So change accordingly.
EXPLANATION
ADDRESS function returns a text of address based on input you give. For input 8 it'll give H1
=INDEX(INDIRECT(SUBSTITUTE("H1","1","")&1&":"&SUBSTITUTE("H1","1","")&100),MATCH(FALSE,ISBLANK(INDIRECT(SUBSTITUTE("H1","1","")&1&":"&SUBSTITUTE("H1","1","")&100)),0))
SUBSTITUTE function then strips down the 1 and gives output only H, which is then used with INDIRECT function to get the range.
=INDEX(INDIRECT("H"&1&":"&"H"&100),MATCH(FALSE,ISBLANK(INDIRECT("H"&1&":"&"H"&100)),0))
=INDEX(INDIRECT("H1:H100"),MATCH(FALSE,ISBLANK(INDIRECT("H1:H100")),0))
Rest is exactly your formula.
i use this formula
=IF(OR(J2={"F";"S";"P"});Inventaire!D14; IF(OR(J2={"Mat.IN";"Mat.OUT"}); Inv.Materiel!D14; ""))
but it only refer to J2 if blank
i want to add if Inventaire!D14 is blank to "" don't show 0
is there anyway to check if 2 cell are blank at same time ?
thanks for your help
You can just wrap your output in another if statement to check if the result is empty, then output ""
=IF(ISBLANK(IF(OR(J2={"F";"S";"P"}),Inventaire!D14:IF(OR(J2={"Mat.IN";"Mat.OUT"}),Inv.Materiel!D14,""))),"",IF(OR(J2={"F";"S";"P"}),Inventaire!D14:IF(OR(J2={"Mat.IN";"Mat.OUT"}),Inv.Materiel!D14,"")))
To check if two cells are blank, use this code:
=IF(AND(ISBLANK(B3),ISBLANK(C3)), 1, 0)
Above, is cells C3 and B3 are blank, the function will return 1. If either or both have values, it'll return a 0. Hope this helps. I'm not sure how you incorporate this into your own function.
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.
I can't come up with the right formula for this.
Cell B3 contains a value. In cell C3 is the formula which should calculate: if B3 exceeds 1500, i want it to display the difference.
E.g. IF value of B3 is 1600, C3 should display 100.
Thanks, can't get my head around it.
If you want it to show the value of B3 when that value is less than or equal to 1500, and to show the difference if it is greater, use the following:
=IF(B3>1500,B3-1500,B3)
If you want it to show nothing if it is less than or equal to 1500, use:
=IF(B3>1500,B3-1500,"")
=if(B3>1600;B3-A3;"")
Honestly i didn't catch the other operand of the difference you describe, but that is the If formula..
hope it helps..
=IF(B3>1500;B3-A3;"")
As you mentioned if value is greater than 1500 so the formula should be as above.