I'm trying to create a spreadsheet with nested if and statements but I keep getting a too many arguments error (despite using an example I found online). Can anyone see where I'm going wrong? I've been googling fruitlessly for a while!
= IF(AND(D5>=$M$3, E5<=$M$4),
F5,
IF(AND(D5>=$M$3, D5<=$M$4),
NETWORKDAYS(D5, $M$4, ($U$5:$U$68),
IF(AND(E5>=$M$3, E5<=$M$4),
NETWORKDAYS($M$3, E5, ($U$5:$U$68))))
Your NETWORKDAYS formulas are incorrect:
You have:
NETWORKDAYS(D5,$M$4,($U$5:$U$68)
should be:
NETWORKDAYS(D5,$M$4,$U$5:$U$68)
although
NETWORKDAYS(D5,$M$4,($U$5:$U$68))
would also work, but the parentheses around the holidays argument are redundant.
Related
Sorry i know this is super basic but i didn't know where else to ask and i really feel like the answer is right in front of me...
I have a spreadsheet which im going to use to log PAT test results. When i select the test type from a drop down it changes the standards and thresholds in the bit below and will tell me if each test passes or fails. It uses several vlookups and relative references - so far no VBA. Looking at this photo. What I'm trying to do is get the formula in cell I13 to read the symbol in F13 and use that in the formula rather than typing the symbol directly into the formula as its going to change when i change the Class Type option.
So far ive gotten to this (has a blank IF to start with to keep it neat:
=IF(H13="","",IF((H13&F13&(VALUE(G13))),"PASS","FAIL"))
The bit in bold is where the issue is. When i run the evaluate formula it boils the bold bit down to "0.01>2" which is correct however it then wont read that in the larger IF statement - i think its the quotation marks. So i think it needs another function to allow the IF statement to read that as the logical test rather than a text string.
I've tried VALUE, FORMULATEXT, NUMBERTEXT, all the ones that might be close to what I'm trying to do but 100% stumped now. Always bring sup the #VALUE Error.
Appreciate any advice? TIA
There is no built-in function for that. You need either a VBA function or the old EVALUATE XLM function (which you can't use directly in a cell, it has to be in a defined name). Sample UDF:
Function EvaluateFormulaString(FormulaString as string)
EvaluateFormulaString = application.evaluate(formulastring)
End Function
then your formula would become:
=IF(H13="","",IF(EvaluateFormulaString(H13&F13&(VALUE(G13))),"PASS","FAIL"))
I've got another one that is really kicking my butt.
I know why the error is occurring. I just don't know how to fix it. There are a lot of IF statements so I'm thinking maybe they are arranged in a way that is causing the error. I'm sure there is a much cleaner way to write them.
Whenever I try to input data into D7 or E7 I get the circular reference error.
These are my current formulas for all relevant cells:
F7: =IF(C7<0,"FAIL",IF(OR(ISBLANK(B7),ISBLANK(C7))," ",IF(ABS(F8)<=30,"PASS","FAIL")))
G7: =IF(D7<0,"FAIL",IF(OR(ISBLANK(B7),ISBLANK(D7))," ",IF(ABS(G8)<=30,"PASS","FAIL")))
H7: =IF(E7<0,"FAIL",IF(OR(ISBLANK(B7),ISBLANK(E7))," ",IF(ABS(H8)<=30,"PASS","FAIL")))
F8: =IF(B7<0,"",IF(C7<0,"",IF(D7<0,"",IF(E7<0,"",IF(G7="FAIL","",IF(H7="FAIL","",IF(ISBLANK(B7),IF(ISBLANK(C7),"","input Lw_Lw"),IF(ISBLANK(C7),"input Lw_Up",SUM(C7-B7)))))))))
G8: =IF(B7<0,"",IF(C7<0,"",IF(D7<0,"",IF(E7<0,"",IF(F7="FAIL","",IF(H7="FAIL","",IF(ISBLANK(B7),IF(ISBLANK(D7),"","input Lw_Lw"),IF(ISBLANK(D7),"input Up_Lw",SUM(D7-B7)))))))))
H8: =IF(B7<0,"",IF(C7<0,"",IF(D7<0,"",IF(E7<0,"",IF(G7="FAIL","",IF(F7="FAIL","",IF(ISBLANK(B7),IF(ISBLANK(E7),"","input Lw_Lw"),IF(ISBLANK(E7),"input Up_Up",SUM(E7-B7)))))))))
Snip of Excel table
Any help would be much appreciated!
I worked out the following two formulas for you. Please try them.
[F7] =IF(IFERROR(ABS(F8)<=30,FALSE),"PASS","FAIL")
[F8] ==IF(ISBLANK(C7),"input "&F$3,IF(OR(COUNT($B7:$E7)<4,COUNTIF($B7:$E7,"<0")>0),"",SUM(C7-$B7)))
Copy them from F7:F8 to G7:H8.
The basic principle I applied in order to avoid a circular reference is to do all testing in row 8 with the outcome that F8 will either hold a blank or a number. Therefore "Pass" or "Fail" in row 7 can be decided based on the number: If the number is within range it's a PASS, else it's failed. Note that Abs("") will cause an error. Therefore IFERROR(ABS(F8)<=30,FALSE) will return False in case F8 = "". Effectively, this is the reverse of what I wrote in my comment above.
I looked for shorter expressions for other tests as well. Count() will only count cells with numbers in them. Therefore I use this function instead of a series of ISBLANK() queries. Similarly for COUNTIF($B7:$E7,"<0").
I used mixed absolute and relative addressing to enable copying formulas to other columns and referred to the column captions in place of repeating the same texts in the formulas.
I didn't fully test my solution. However, with my above explanation as a guide you should be able to take possession and eliminate any errors I might have left behind.
I'm trying to do a search for multiple strings in a cell with an OR-condition in Excel 2016.
E.g. I have a string abcd1234 and I want to find ab OR 12.
I'm using the german version where the function SEARCH is called SUCHEN and it should behave the same way.
I found this answer which suggests this solution:
SEARCH({"Gingrich","Obama","Romney"},C1).
I also found this website which suggests the same syntax:
SEARCH({"red","blue","green"},B5)
Same with this website:
SEARCH({"mt","msa","county","unemployment","|nsa|"},[#Tags])
So they basically say make a list of search terms separated by commas enclosed by curly braces and you're good.
But putting these into Excel 2016 just results in the usual meaningless Excel error message which says there was an error with the formula and it's always highlighting the whole part in curly braces.
Taking the first example the only way I could get Excel to not throw its error message was to change the syntax like this:
=SEARCH({"Gingrich";"Obama";"Romney"};C1)
But separating the search terms with semicolons doesn't apply the OR-condition correctly, so this is not the solution.
I'm aware from this answer that I could make separate searches and string them together with a condition, but I would like to avoid that, and I also want to know why the syntax that is supposed to work as confirmed by multiple sources is not working for me.
EDIT:
Okay, I'm starting to understand this, thanks to Solar Mike:
The code =IF(COUNT(SEARCH({"Romney","Obama","Gingrich"},A1)),1,"") works indeed perfectly fine.
Also =COUNT(SEARCH({"Romney","Obama","Gingrich"},A1)) works.
But =SEARCH({"Romney","Obama","Gingrich"},A1) does not.
Also =ISNUMBER(SEARCH({"Gingrich","Obama","Romney"},A1)) does not work.
I'd love to know the reason why.
Ok, so this works:
OR(IFERROR(FIND("ab",A1,1),0),IFERROR(FIND("12",A1,1),0))
tested here :
I followed one of the links and the version like this:
=IF(COUNT(SEARCH({"Romney","Obama","Gingrich"},C1)),1,"")
worked as expected for me, but if the search is isolated it then fails and I have not found an explanation ...
Like other array-style formulas, the part that delivers the array has to be enclosed in some sort of aggregate function to make it scan through the array - otherwise it only looks at the first element of the array. So anything like COUNT, SUM, SUMPRODUCT will do the trick.
My preferred one is
=OR(ISNUMBER(SEARCH({"a","b","c"},A1)))
because you can easily change it to this if you want AND logic:
=AND(ISNUMBER(SEARCH({"a","b","c"},A1)))
I'm trying to get this into excel: e^(-(2.2/9.58)^2)
According to my graphical calculator AND wolfram alpha this should give: 0.9486
However when I type it in excel with the following formula: =EXP(-(2.2/9.58)^2) I get 1.054
I've tried multiple different things but I still can't get the right answer out of it. What am I doing wrong with the formula in Excel??
Excel seems to mess up the brackets and does some distribution on its own. Very odd.
=EXP(-((2,2/9,58)^2)) should work
By way of some explanation, in Excel (as conventional) the negation operator has precedence over exponentiation. So:
=EXP(-(2.2/9.58)^2)
is treated just as:
=EXP((-2.2/9.58)^2)
or
=EXP(0.052737)
would be, hence resulting in 1.05415. Whereas:
=EXP(-0.052737)
is 0.948629.
I am using Excel Formula OR in an Excel formula and am little surprised the way it is behaving.
I am using the following Excel formula :
=IF(OR(ISERROR(funct(A1:A5)), funct(A1,A5)=0), "ERROR", funct(A1,A5))
My understanding was that, if ISERROR(funct(A1:A5)) True(or False), the result of OR operation would be True(or False).
In my experiment, I was expecting the answer to be "ERROR" as the ISERROR(funct(A1:A5)) results in true.
But I am getting #VALUE! error. Any Idea what could be wrong. Or if I can rephrase the formula to make it work.
Thanks
=IF(ISERROR(funct(A1:A5)),"ERROR",IF(funct(A1:A5)=0,"ERROR",funct(A1:A5)))
I recommend Tim's answer but if func() is a large function, as you say, then you might want to minimise the number of times it's used. I'm assuming that the same function should be invoked throughout the formula, i.e. func(A1:A5)
In Excel 2007 or later you could use IFERROR function:
=IFERROR(IF(func(A1:A5)=0,"ERROR",func(A1:A5)),"ERROR")
or in earlier versions you could force func(A1:A5) to give an error when equal to zero by dividing 1 by func(A1:A5):
=IF(ISERROR(1/func(A1:A5)),"ERROR",func(A1:A5))
Edit: Taking that one step further you could combine both of those approaches in Excel 2007 or later so that you only need to call func once:
=IFERROR(1/(1/func(A1:A5)),"ERROR")
I think you're missing a close bracket.
Try this:
=IF(OR(ISERROR(funct(A1:A5)), func(A1,A5)=0), "ERROR", func(A1,A5))
=IF(OR(ISERROR(funct(A1:A5)), funct(A1,A5)=0), "ERROR", func(A1,A5)) - close look at your formula resulted in the suggestion: funct(A1,A5)=0 and func(A1,A5) are really different functions, or this is a typo in your formula? Perhaps that's the case.