need advice about altering array formula - excel

I wrote an Excel program in which I am using the following array formula:
{=SMALL(IF($G$2=$B$2:$B$70,ROW($B$2:$B$70)-ROW($B$2)+1),ROW(1:2))}
Although the program works as desired, at some points the involved data is a non existing item which is displayed by the usual error notation #NUM!. I would prefer that, instead #NUM! the program displays a zero or, better still, a text such as "non existing". Please advise.

Related

Basic IF Statement question -probably right in front of me

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"))

EXCEL - Circular Reference Error when Entering Data

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.

Conditional standard deviation? STD.S with IF not working; trying to apply to data after using AVERAGEIFS with same conditions

(I am working with a Spanish interface, so please forgive the code in Spanish (the ; is a , in English, PROMEDIO.SI.CONJUNTO is AVERAGEIFS, INDICE is INDEX, FILA is ROW, DESVEST.M is STD.S, SI is IF, Y is AND).
I have look through all the threads about a "stvifs" (which Excel really should think about in the future!) and I am still unable to apply what I've learned to my data, even though it seems exactly like what I've seen! After successfully applying the following to my data:
=PROMEDIO.SI.CONJUNTO(E:E;A:A; INDICE(I:I; 2+(FILA(1:1)-1));D:D; 1;F:F; "BC")
I automatically got my column with "BC" and their means for each participant. (I have four conditions in total.) Now I want the SD for the SAME conditions. I tried applying this code as an array formula:
{=DESVEST.M(SI(Y((A:A)=INDICE(I:I; 2+(FILA(1:1)-1));(D:D)=1;(F:F) ="BC");E:E))}
I get a #DIV/0! error. I debugged the formula, and it is giving me FALSE as a result within the STD.S, hence the error. But what I don't understand is why it's not giving me an array with all the values in the column E that comply with the given conditions! The interesting thing is that when I apply the formula normally, it gives me STD.S(E:E) correctly, so I feel that this should work! I have done something similar with other data, but there weren't multiple conditions. Please help!
The formula would look something like this (in English) but not sure about ROW part and can't test it properly without some sample data:-
=STDEV.S(IF((A1:A10=INDEX(I1:I10, 2+ROW(1:1)-1))*(D1:D10=1)*(F1:F10 ="BC"),E1:E10))
Have limited it to 10 rows to make debugging easier with 'Evaluate Formula'.
This gives the stdev (sample) of the three shaded cells:-

Excel 2013 formula throws #Value! error with SAP Business Objects Dashboard

I am using this Excel formula
=IF(C92=0,D102,D101)
It is throwing a #Value! error for my SAP Business Objects Dashboard 4.1 (SP7).
Is there another way to write this formula?
My guess is that SAP does not like using zero for C92=0.
There are several possibilities as to the cause of the error but most will be loosely based upon the fact that you are trying to compare a numerical zero to a cell containing a text string or a blank cell. The cell may even contain a zero as text (e.g. ="0"); a numerical 0 is not the same thing as text-that-looks-like-a-zero.
If you use the VALUE function and wrap some error control around it to accommodate cases when numerical conversion is impossible then you should get consistent results.
=IF(IFERROR(VALUE(C92), 0)=0, D102, D101)
The IFERROR function is used to provide a zero when numerical conversion is not possible. This is my 'best guess' at what you want to occur. Another scenario would be to provide an outside result if not conversion is possible.
=IFERROR(IF(VALUE(C92)=0, D102, D101), "something else")
There are a number of other possibilities. If you have trouble getting the results you expect, please edit your question to include more detail on what outcome(s) you would expect for different case scenarios.

Using trim function on table references

I'm attempting to aggregate from an imported data source in excel. I have 2 combo boxes that specify conditions for a sumifs function (selected using offsets).
Where I struggle is that the data doesn't seem to match unless I use a trim function (I tested this on by adding a column to the data table).
The following formula always returns 0
=SUMIFS(Table_ExternalData_1[RedFlag],Table_ExternalData_1[RAGSTATUS],"=trim("&ReconAggregation!$A4&")",Table_ExternalData_1[ClientDescription],"=trim("&OFFSET(Lists!$A$1,Lists!$B$1,0)&")", Table_ExternalData_1[AgencyDescription],"=trim("&OFFSET(Lists!$C$1,Lists!$D$1,0)&")")
when I add the trims
=SUMIFS(Table_ExternalData_1[RedFlag],trim(Table_ExternalData_1[RAGSTATUS]),"=trim("&ReconAggregation!$A4&")",trim(Table_ExternalData_1[ClientDescription]),"=trim("&OFFSET(Lists!$A$1,Lists!$B$1,0)&")", trim(Table_ExternalData_1[AgencyDescription]),"=trim("&OFFSET(Lists!$C$1,Lists!$D$1,0)&")")
it tells me that I have a formula error. Any idea why? Is there a better way to do this?
Cheers,
G
it tells me that I have a formula error
Maybe there's problem with your "
=SUMIFS(Table_ExternalData_1[RedFlag],trim(Table_ExternalData_1[RAGSTATUS]),"=trim('&ReconAggregation!$A4&')",trim(Table_ExternalData_1[ClientDescription]),"=trim('&OFFSET(Lists!$A$1,Lists!$B$1,0)&')", trim(Table_ExternalData_1[AgencyDescription]),"=trim('&OFFSET(Lists!$C$1,Lists!$D$1,0)&')")
As It happens, the "=" were not required on the right hand side. This was found through trial and error. Still unsure as to why the trim function on the left prompted an error, but with additional cleansing of the source data it wasn't required. Thanks all for your input.

Resources