IF function issues - excel-formula

I am trying to run multiple IF scenarios using this formula:
=IF(B6=$B$100,(IF(H6>75,$D$100,IF(H6>65,$D$101,IF(H6>55,$D$102,IF(H6>0,$D$103,
IF(B6=$B$105,(IF(H6>75,$D$105,IF(H6>65,$D$106,IF(H6>55,$D$107,IF(H6>0,$D$108,
IF(B6=$B$110,(IF(H6>75,$D$110,IF(H6>65,$D$111,IF(H6>55,$D$112,IF(H6>0,$D$113,
IF(B6=$B$115,(IF(H6>75,$D$115,IF(H6>65,$D$116,IF(H6>55,$D$117,IF(H6>0,$D$118,
IF(B6=$B$120,(IF(H6>75,$D$120,IF(H6>65,$D$121,IF(H6>55,$D$122,IF(H6>0,$D$123,"Error"))))))))))))))))))))))))))))))
The issue is it will not look past the first line and will return "FALSE" if the answer doesn't equal cell B100, can anyone help me out?

You need to close the parentheses for the IFs testing H6 before you move on to the next test of B6. I think you mean this:
=IF(B6=$B$100,IF(H6>75,$D$100,IF(H6>65,$D$101,IF(H6>55,$D$102,IF(H6>0,$D$103,"Error")))),
IF(B6=$B$105,IF(H6>75,$D$105,IF(H6>65,$D$106,IF(H6>55,$D$107,IF(H6>0,$D$108,"Error")))),
IF(B6=$B$110,IF(H6>75,$D$110,IF(H6>65,$D$111,IF(H6>55,$D$112,IF(H6>0,$D$113,"Error")))),
IF(B6=$B$115,IF(H6>75,$D$115,IF(H6>65,$D$116,IF(H6>55,$D$117,IF(H6>0,$D$118,"Error")))),
IF(B6=$B$120,IF(H6>75,$D$120,IF(H6>65,$D$121,IF(H6>55,$D$122,IF(H6>0,$D$123,"Error")))),
"Error"
)))))

Related

NetSuite CASE WHEN not working even though all individual statements work

I am having an issue with NetSuite's CASE WHEN in a saved search.
This works as a Formula (Text):
CASE WHEN {type} THEN 'Kit' ELSE 'not kit' END
These work as Formula (Numeric):
min(({memberitem.quantityonhand}/NULLIF({memberquantity},0))/(NULLIF({memberitem.preferredStockLevel}/NULLIF({memberquantity},0),0)))
and this
{quantityonhand}/NULLIF({preferredstocklevel},0)
But when I try to put them together as a Formula (Numeric) they fail:
CASE WHEN {type}='Kit/Package' THEN min(({memberitem.quantityonhand}/NULLIF({memberquantity},0))/(NULLIF({memberitem.preferredStockLevel}/NULLIF({memberquantity},0),0))) ELSE {quantityonhand}/NULLIF({preferredstocklevel},0) END
I tried having multiple CASE WHEN statements too:
CASE WHEN {type}='Kit/Package'
THEN min(({memberitem.quantityonhand}/NULLIF({memberquantity},0))/(NULLIF({memberitem.preferredStockLevel}/NULLIF({memberquantity},0),0)))
ELSE
CASE WHEN {type}='Inventory Item'
THEN {quantityonhand}/NULLIF({preferredstocklevel},0)
ELSE 'nope'
END
ELSE 'nope'
END
Still not working.
I am thinking that the issue could be that my CASE WHEN statement is meant for Formula (Text) and my output is meant for Formula (Numeric). If that is the case, how do I check my item type in a numeric format, or is my code just wonky?
Thanks in advance.
Ok. I wanted to follow up here and post the answer that I figured out based on help in the comments.
#Brian figured out the issue and gave me the advice that I needed to get it working. He was correct - I had mixed aggregates with non-aggregates. Here is what ended up working:
CASE WHEN {type}='Kit/Package' THEN ({memberitem.quantityonhand}/NULLIF({memberquantity},0))/(NULLIF({memberitem.preferredStockLevel}/NULLIF({memberquantity},0),0)) ELSE {quantityonhand}/NULLIF({preferredstocklevel},0) END
So you can see that what worked was to remove the min() function from the kit portion. I still need to figure out how to get the correct kit inventory numbers, but #Brian's advice solved the main issue.

Excel IF(OR) - two OR's formula works but three doesn't?

I can get a two possibility formula to work but not a three. I thought it would just be adding a comma for another term then adding a comma for a value. Please can anyone tell me why its not working?
Working one:
=IF(OR(C6="buy", C6="hold"),(F5*(D6+1)),(E5*(D6+1)))
Not Working:
=IF(OR(C6="buy", C6="hold", c6="sell"),(F5*(D6+1)),(E5*(D6+1)),0)
After reading your problem description couple of times over I think you need below formula:
=CHOOSE(MATCH(C6,{"buy","hold","sell"},0),(F5*(D6+1)),(E5*(D6+1)),0)
In your second formula you have two parts (E5*(D6+1)) and 0 for the Value is False section, this version will work: =IF(OR(C6="buy", C6="hold", C6="sell"),(F5*(D6+1)),(E5*(D6+1)))

Nested If shows #VALUE

I have below formula. Its working for two first conditions.
=IF(F3="","",IF(F3="RUB",IF(FIND("2600",J3),MID(J3,FIND("2600",J3),14)),
IF(F3<>"RUB",IF(FIND(":59:",J3),MID(J3,FIND(":59:",J3)+5,14),
IF(F3<>"RUB",IF(FIND(":59F",J3),MID(J3,FIND(":59F",J3)+6,14)
))))))
but if if met below condition , it shows #VALUE!
IF(F3<>"RUB",IF(FIND(":59F",J3),MID(J3,FIND(":59F",J3)+6,14)
Is there any suggestions how to get it work?I tried to combine with OR and with IFERROR, but give no result.
There are still some 'holes' in your logic that were not covered by either your formula or narrative. These will return FALSE. However, this is closer to what you are trying to accomplish.
=IF(F3="", "", IF(F3="RUB", IF(ISNUMBER(FIND("2600", J3)), MID(J3, FIND("2600", J3), 14)),
IF(F3<>"RUB", IF(ISNUMBER(FIND(":59:", J3)), MID(J3, FIND(":59:", J3)+5, 14),
IF(ISNUMBER(FIND(":59F", J3)), MID(J3, FIND(":59F", J3)+6, 14))))))
I assume the problem with this:
IF(F3<>"RUB",IF(FIND(":59F",J3),MID(J3,FIND(":59F",J3)+6,14)
Is that the search text :59F cannot be found in the cell J3. If you change to this:
IF(F3<>"RUB",IF(ISNUMBER(FIND(":59F",J3)),MID(J3,FIND(":59F",J3)+6,14)
It should fix the problem.
EDIT shorter solution
IF(F3<>"RUB",IFERROR(MID(J3,FIND(":59F",J3)+6,14)
On a side note, your IF(F3<>"RUB",...) is superfluous because you already have a previous condition IF(F3="RUB",...), so it is a given that F3<>"RUB" if it didn't make it past the first condition.

Simple Excel IF statement not working.

I have no idea why this isn't working. It looks exactly like multiple sources I have found around the web. What am I missing?
Code:
=IF(A1="Select all",B1="Yep",B1="Nope")
This is the result:
You only need to put the result values in the 2nd and 3rd arguments:
=IF(A1="Select all","Yep","Nope")
It looked like you were trying to assign the values to B1 cell, but what actually happens is you get the result of doing a comparison to check whether B1 is equal to "Yep", which is causes a circular reference error because the formula tries to look at itself.
You don't need to say B1="Yep" Just put
=IF(A1="Select all", "Yep", "Nope")

Excel ISNUMBER Function with IF Statement

I have an Excel file I'm working with. There is a column that contains numbers and text, sometimes it's just one or the other. I'm trying to write a function that scans the left most part of the cell to see if it starts with a number. I thought I had it but apparently not. This is what I had:
=IF(ISNUMBER(LEFT(E8,1)), "True", "False")
This continues to throw me a "false" result even though that particular cell, E8, begins with a "3". What am I missing here?
Try this out:
=IF(ISNUMBER(VALUE(LEFT(E8,1))),"True","False")
Using the IF statement is redundant. The most simple and effective way to achieve your desired result is:
=ISNUMBER(--LEFT(E8,1))
It will automatically return TRUE or FALSE
Note that you can achieve what you require with just the following:
=NOT(ISERROR(LEFT(E8)*1))
If you do not LEFT(E8) evaluates to LEFT(E8,1) and multiplication by 1 throws an error on anything non-numeric
If you need your output as strings then update as per below:
IF(NOT(ISERROR(LEFT(E8)*1)),"True","False")
EDIT
Using ISNUMBER() is a good alternative to NOT(ISERROR())
=ISNUMBER(LEFT(A1)*1)
=IF(ISNUMBER(LEFT(A1)*1),"True","False")
=IFERROR(IF(VALUE(LEFT(E8,1)),"TRUE","FALSE"),"FALSE")

Resources