I've been using =Cell("address",... to error check formulas I'm making to create a database and it's been working pretty well until I tried to scale up my index match formulas with some if statements.
I've narrowed the issue down to where I believe it's working as intended as long as the first statement in the if statement is true, yet if the calculation goes past that (even if the original formula is fine and returns a value) it will come back with #VALUE!.
EDIT: To be clear, the formula used above returns values without issue when not using the CELL-ADDRESS function involved. The formula also returns values when split up outside the IF-Statement.
I2=Valid
=CELL("address",IF($I$2="Valid",INDEX($I$2:$J$6,MATCH($U$1,$H$2:$H$6,0),MATCH($V$1,$I$1:$J$1,0)),IF($I$2="Invalid",INDEX($I$2:$J$6,MATCH($W$1,$H$2:$H$6,0),MATCH($V$1,$I$1:$J$1,0)),"Error")))
$I$2 is returned in the cell
I2=Invalid
=IF($I$2="Valid",INDEX($I$2:$J$6,MATCH($U$1,$H$2:$H$6,0),MATCH($V$1,$I$1:$J$1,0)),IF($I$2="Invalid",INDEX($I$2:$J$6,MATCH($W$1,$H$2:$H$6,0),MATCH($V$1,$I$1:$J$1,0)),"Error"))
#VALUE! is returned
Can anyone offer a fix for this or explain why it's happening and how to avoid it?
Any help would be appreciated.
Thanks!
Related
I'm admittedly new to using VLOOKUP in Excel, but I've run through a few tutorials on this and can't figure out what I'm doing wrong here. I'm attaching a sample of the table I'm working with, where I'm attempting to match a value (ZPOP) that is dependent on another value (ZIPCODE). The formula I'm using is
=VLOOKUP(A2,M:N,2,TRUE)
When I do the same as you, it looks like the formula is exact.
But, there's one thing in your Excel sheet: there is a warning at the beginning of your A-column. In order to reproduce this, I've replaced the value 59001 by '59001 (mind the single quote), and there the problem arises too.
Please check the warning of your A column and do some reformatting of that value, if possible.
I'm attempting to return a string of values that match multiple sets of criteria. All of the criteria except for the one that looks to see if the value matches a key seem to be working. I believe it has something to do with combining a array formula with a OR statement.
I was able to create one formula that worked using the TRANSPOSE function however, once I dragged it down my excel prompted me with the below error message. (Assuming it is too much data to compute)
Here is the formula that worked initially:
=TEXTJOIN(", ",TRUE,IF(('Sample Check Data'!$A:$A=Solution!B3)*('Sample Check Data'!$T:$T=Solution!D3)*('Sample Check Data'!$J:$J>Solution!G3)*('Sample Check Data'!$M:$M=TRANSPOSE(Criteria!$A$2:$A$8)),'Sample Check Data'!$H:$H,""))
Image
As an alternative, I built this formula which continues to fail to return a #VALUE Error (The bold highlight is what's causing it to fail. I, unfortunately, can't figure out the issue. Does anyone know how to resolve?:
=TEXTJOIN(", ",TRUE,IF(**'Sample Check Data'!$M:$M=OR(Criteria!$A$2:$A$8)***('Sample Check Data'!$A:$A=Solution!B3)*('Sample Check Data'!$T:$T=Solution!D3)*('Sample Check Data'!$J:$J>Solution!G3),'Sample Check Data'!$H:$H,"NoDataFound"))
I found the transpose solution on this thread but it did not mention any memory issue resulting from its use. TEXTJOIN based on multiple columns and multiple IF conditions
Any help or alternative solution would be greatly appreciated.
Update:
After some more trial and error I found a solution, however I'm still running into the Excel Ran Out of Resources Error.
=TEXTJOIN(", ",TRUE,IF(('Sample Check Data'!$A:$A=Solution!B3)*('Sample Check Data'!$T:$T=Solution!D3)*('Sample Check Data'!$J:$J>Solution!G3)* (('Sample Check Data'!$M:$M=Criteria!$A$2) +('Sample Check Data'!$M:$M=Criteria!$A$3)+('Sample Check Data'!$M:$M=Criteria!$A$4) +('Sample Check Data'!$M:$M=Criteria!$A$5)+('Sample Check Data'!$M:$M=Criteria!$A$6)+('Sample Check Data'!$M:$M=Criteria!$A$7)+('Sample Check Data'!$M:$M=Criteria!$A$8)),'Sample Check Data'!$H:$H,""))
I attempted to modify the column references from $A:$A to $A$1:$A$10000 that way less computing power is required. After making this change I now receive a N/A error. Are there any suggestions?
Hi I am trying to write a formula where if cell (J$4) = 1120 then it would run one statement, whereas if cell (J$4) = 1120s it would run another. I am using index-match to lookup the appropriate value. However, I can't seem to get my formula to work and I was wondering if you guys can find my error. The error is 'you've entered too many arguments for this function'. Any help would be appreciated! Thank you!
formula:
=IFERROR(IF(J$4="1120S",INDEX(B1HY3!$A$3:$F$300,MATCH("L 22a",B1HY3!$F$3:$F$300,0),5),IF(J$4=1120,INDEX(B1HY3!$A$3:$f$300,MATCH("L 22a",B1HY3!$f$3:$f$300,0),5)+INDEX(B1HY3!$A$3:$F$300,MATCH("L 22b",B1HY3!$F$3:$F$300,0),5),0),0)
Always try to follow parentheses' colors it is quite useful when handling with large formulas,furthermore try always to evaluate your formulas to check where the error is.
It worked for me:
=IFERROR(IF(J$4="1120S",INDEX(B1HY3!$A$3:$F$300,MATCH("L 22a",B1HY3!$F$3:$F$300,0),5),IF(J$4=1120,INDEX(B1HY3!$A$3:$F$300,MATCH("L 22a",B1HY3!$F$3:$F$300,0),5)+INDEX(B1HY3!$A$3:$F$300,MATCH("L 22b",B1HY3!$F$3:$F$300,0),5))),0)
It was nessesary to close the parenthesis of the second if
I just replaced the values within a formula and now it's value errors all the way, I'm not sure why:
old formula: =COUNTIFS(Cat,M$3,Sup,$B45)
new formula: =COUNTIFS(Cat,M$3,Client,$B45)
simply doing =COUNTIFS(Cat,M$3) and =COUNTIFS(Client,$B45) works, but I obviously need the common count of the two!
=SUMPRODUCT(COUNTIFS(Cat,M$3,Client,$B45)) also gives #value error
The named ranges work, so what is the problem?
The solution lies in making sure that the two ranges are of same length, as mentioned in the comment.
I'm hoping to mark this as complete, since voting to close did not work out, but this question has been resolved.
I've always had trouble with this one over the years! I don't seem able to get the OR function in Excel to work.
In my model, the cell E46 should contain either a valid Postcode or the value "none". Unfortunately I have also encountered a "#value" in E46 so have written the following formula to trap this error and return "None" if encountered:
=IF(OR(E46="None",ISERROR(E46)),"None",VLOOKUP(E46, List,2,FALSE))
Trouble is, I still get #value returned by this formula when E46 contains #value even though I think I am trapping it!
All the help texts suggest I have written the formula correctly – I cannot see what I am doing wrong. Any helpful suggestions gratefully received.
You can't use OR when there might be an error in there (because the OR function will give an error in that case - from E46="None" part), try trapping the error first with nested IFs, e.g.
=IF(ISERROR(E46),"None",IF(E46="None",E46,VLOOKUP(E46, List,2,FALSE)))
You'd still get an error if E46 isn't in List......
If you have Excel 2007 or greater you can use IFERROR like
=IFERROR(IF(E46="None",E46,VLOOKUP(E46, List,2,FALSE)),"None")