+ Reply to Thread
Results 1 to 32 of 32

#NA's resistant to defeat !

  1. #1
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Smile #NA's resistant to defeat !

    I need to put this in context.

    Find file attached.

    It started with a fairly straight-forward array problem. The OP solved it themselves, but I wanted to try something different “off-post”.

    http://www.excelforum.com/excel-form...rom-range.html

    Hopefully that will describe what I was basically trying to do…..along with some other “stuff”. My solution generated the desired outcomes successfully. It was the NA errors that had me stymied.

    In column A the data.
    In columns B:C the desired outcome.
    In columns E:F my first error-trap attempt (failed).
    In columns H:I my second failed attempt and in columns K:L my successful attempt.

    My attempt to suppress these with IFERROR failed. An attempt to apply a LOOKUP / CHOOSE strategy I picked up in another recent thread didn’t work either…..but together they worked!

    This example is probably not a good representative of my question. To be sure having a better designed formula in the first place is the better solution in this case, but can anyone tell me why some #NA errors are so resistant, and why this nested attempt worked when the others wouldn’t?

    Any thoughts?
    Attached Files Attached Files

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: #NA's resistant to defeat !

    What do you want to do with your data
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: #NA's resistant to defeat !

    last position is IFERROR(5,"") and result should be 5 not #N/A, right? or if error than: ""

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    Quote Originally Posted by nflsales View Post
    What do you want to do with your data
    No plans for that. I was just wanting to try / learn something.......and these resistant #NA's showed up. The issue has been pestering me for over a year now. I saw opportunity to ask the question......with context.....so I posted the question.

    Does data usage impact your answer?

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    Quote Originally Posted by sandy666 View Post
    last position is IFERROR(5,"") and result should be 5 not #N/A, right? or if error than: ""
    Not the problem at all. It returns the numbers as expected. It returns #NA's as expected. It's the resistance of #NA suppression that has me stymied. I even stumbled upon a way to take care of that. I just don't understand how it works when nothing else did..........and why it is such a challenge in the first place.

    Edit: BTW this is not a pressing problem. This is about furthering my Excel education.
    Last edited by FlameRetired; 03-19-2015 at 02:49 AM.

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: #NA's resistant to defeat !

    OK, but this is not a "one post" problem I think

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    Quote Originally Posted by sandy666 View Post
    OK, but this is not a "one post" problem I think
    I don't understand.

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: #NA's resistant to defeat !

    I mean I try to look at this more. Saturday and Sunday soon so there will be more free time

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    Thank you sandy666. I appreciate it.

  10. #10
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: #NA's resistant to defeat !

    Hm.. nice question but me too puzzled by the way the Iferror() reacts


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    Quote Originally Posted by :) Sixthsense :) View Post
    Hm.. nice question but me too puzzled by the way the Iferror() reacts
    Yeah! Me, too. It's never made any sense to me.

  12. #12
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: #NA's resistant to defeat !

    Quote Originally Posted by FlameRetired View Post
    Yeah! Me, too. It's never made any sense to me.
    I posted this in Call In The Cavalry to get everyones view/suggestion

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    Quote Originally Posted by :) Sixthsense :) View Post
    I posted this in Call In The Cavalry to get everyones view/suggestion
    Bless your heart and thank you......I thought that's probably where this would go.

  14. #14
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: #NA's resistant to defeat !

    As far as I can see your first IFERROR formula can only return two results but you array entered it into more rows. The N/A isn't returned by the formula itself, it's Excel indicating there is nothing to return in the additional rows.
    Remember what the dormouse said
    Feed your head

  15. #15
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    Quote Originally Posted by romperstomper View Post
    ........... but you array entered it into more rows. The N/A isn't returned by the formula itself, it's Excel indicating there is nothing to return in the additional rows.
    Correct. Are you saying that because of the nature of this array formula...... needing to be committed CSE to the entire range at once...... is what's causing this?

  16. #16
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: #NA's resistant to defeat !

    Quote Originally Posted by FlameRetired View Post
    Are you saying that because of the nature of this array formula...... needing to be committed CSE to the entire range at once
    If I am not wrong, I read Rory statement as

    "Passing invalid references to Index() function is overriding Iferror() function to let you know that the passed range is not valid"

  17. #17
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    Quote Originally Posted by :) Sixthsense :) View Post
    If I am not wrong, I read Rory statement as

    "Passing invalid references to Index() function is overriding Iferror() function to let you know that the passed range is not valid"
    OK....then I will try the non-INDEX version and see what happens.

  18. #18
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    OK I removed the inner most INDEX and did the standard IF(....., ROW()-MIN(ROW())+1) array construction. There was no change. I'm thinking I may have missed the point and understood the wrong INDEX function to be the issue?

  19. #19
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: #NA's resistant to defeat !

    In A1: 0
    functions as expected:

    Formula: copy to clipboard
    Please Login or Register  to view this content.



  20. #20
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: #NA's resistant to defeat !

    Hi.

    For a start, can I ask why you're passing a ROW/INDIRECT construction as SMALL's k parameter here?

    Have you followed through your formula using the Evaluate Formula tool? If so, you will notice that this construction does not resolve to an array. For example, for your formula in E3:

    =IFERROR(INDEX($A$2:$A$24,SMALL(INDEX(($A$2:$A$24=0)*25^25+ROW($A$2:$A$24)-MIN(ROW($A$2:$A$24))+1,0),ROW(INDIRECT((RIGHT(E$2,1)-1)*2+1&":"&(RIGHT(E$2,1)-1)*2+2)))),"")

    this part:

    ROW(INDIRECT((RIGHT(E$2,1)-1)*2+1&":"&(RIGHT(E$2,1)-1)*2+2))

    will resolve as far as:

    ROW($1:$2)

    though, in the next step, this will not resolve to the desired:

    {1;2}

    but rather to simply the first element within this array, i.e. 1.

    The reason being that, in order to pass an array as one of INDEX's parameters, a little extra coercion is required, e.g.:

    =IFERROR(INDEX($A$2:$A$24,N(IF(1,SMALL(INDEX(($A$2:$A$24=0)*25^25+ROW($A$2:$A$24)-MIN(ROW($A$2:$A$24))+1,0),ROW(INDIRECT((RIGHT(E$2,1)-1)*2+1&":"&(RIGHT(E$2,1)-1)*2+2)))))),"")

    and now the ROW/INDIRECT construction would resolve to the desired array to pass to INDEX, i.e. {1,2}.

    See here for more:

    http://excelxor.com/2014/09/05/index...ray-of-values/

    Secondly, your case just reminds me why I avoid multi-cell array formulas like the plague: far less understood than most people imagine, and not at all simply the equivalent of a single-cell array formula copied down the same number of rows. romperstomper's analysis is spot-on.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  21. #21
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: #NA's resistant to defeat !

    Quote Originally Posted by FlameRetired View Post
    understood the wrong INDEX function to be the issue?
    I am not saying Index is the problem my point is

    Passing invalid references

  22. #22
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    OK. I've F9ed and Fx'd this thing to death. I may have figured something out.

    When I Fx any of the cells that contain NA the last step is IFERROR(5,""). It never occurred to me that could be the problem......5 is not an error but the formula cannot find an available indexed 5 left in the array.....so it returns a different kind of NA.......saying "I can't find an error, but I can't find a 5 either.....so....I'll do this....". Come to think of it that might be what sandy666 was trying to get across earlier.

  23. #23
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    Quote Originally Posted by :) Sixthsense :) View Post
    I am not saying Index is the problem my point is

    Passing invalid references
    Sorry I was writing while you posted. I didn't understand quite what you meant earlier, but I think it's beginning to dawn on me in "Flame-speak" terms.
    Last edited by FlameRetired; 03-19-2015 at 05:09 AM.

  24. #24
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: #NA's resistant to defeat !

    Quote Originally Posted by FlameRetired View Post
    OK. I've F9ed and Fx'd this thing to death. I may have figured something out.

    When I Fx any of the cells that contain NA the last step is IFERROR(5,""). It never occurred to me that could be the problem......5 is not an error but the formula cannot find an available indexed 5 left in the array.....so it returns a different kind of NA.......saying "I can't find an error, but I can't find a 5 either.....so....I'll do this....". Come to think of it that might be what sandy666 was trying to get across earlier.
    No. That's not at all what is occurring. Re-read romperstomper's post and perhaps do some further research on multi-cell array formulas. Or, better still, don't use them in the first place!

  25. #25
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    Quote Originally Posted by XOR LX View Post
    No. That's not at all what is occurring. Re-read romperstomper's post and perhaps do some further research on multi-cell array formulas. Or, better still, don't use them in the first place!
    Yes. You've raised the bar for me on this and I thank you for it. I have read some of those articles N(IF(1, array to coerce) among others. I've even tried it a few times to experiment. This the first time I've seen where I could have put it to use in earnest.

    Yes I did notice the resolve to ROW($1:$2), but I did not notice it not resolving to {1;2}. I have now. Thanks for pointing that out.

    I will go back and look at romperstomper's post. I'm afraid it blew right over my head when I first read it.

    And avoiding multi-cell array formulas altogether.......I see your point.

    RE: For a start, can I ask why you're passing a ROW/INDIRECT construction as SMALL's k parameter here?

    It was for nothing more than my own "off-line" education. I wanted to see if I could........I'm a bit INDIRECT challenged, and as the 'assignment' was to return two groups of two I thought I would try using the column header to start my SMALL k parameter. Please understand when I did all this I had absolutely no idea that I would be posting this mess. The annoying NA really got my interest when I stumbled upon something that worked and I couldn't understand that either......although I think I can now.


    @snb You're formula intrigues me. I will try it and attempt to "unpack" it. Thank you.


    And thank you everyone who contributed to this thread. It's been enlightening.
    Last edited by FlameRetired; 03-19-2015 at 05:51 AM.

  26. #26
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    Quote Originally Posted by romperstomper View Post
    As far as I can see your first IFERROR formula can only return two results but you array entered it into more rows. The N/A isn't returned by the formula itself, it's Excel indicating there is nothing to return in the additional rows.
    Thank you romperstomper........when I first read your post it blew right past me.....and then I was overwhelmed by incoming responses. I get it, now.
    Thank you again.

  27. #27
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    Quote Originally Posted by :) Sixthsense :) View Post
    I am not saying Index is the problem my point is

    Passing invalid references
    Yes. Thank you. I didn't understand the point initially.....but I do now. Thank you for your help.

  28. #28
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    I'm marking this [SOLVED].

  29. #29
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: #NA's resistant to defeat !

    @FlameRetired

    Just to say that I think it's admirable what you're doing here.

    In my opinion there is no better way to learn advanced Excel than to pose oneself such questions, investigate them further, analyse any peculiarities/unexpected results and then attempt to push the boundaries even further with regards to one's understanding of the functions/constructions involved.

    And even better if you share this knowledge on a public forum, to which all may contribute and from which all may learn.

    So keep up the good work and maintain your philosophy of enquiry. There should be more of it about!

    Cheers

  30. #30
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: #NA's resistant to defeat !

    A simpler example to demonstrate: select 4 cells in a column and type ={1;2} then Ctrl+Shift+Enter. The formula itself can't return an error but you're returning an array of two elements to 4 cells so Excel simply fills the rest with #N/A.

  31. #31
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    @ XOR LX

    Thank you for the kind words, encouragement and all your feedback.

  32. #32
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: #NA's resistant to defeat !

    Quote Originally Posted by romperstomper View Post
    A simpler example to demonstrate: select 4 cells in a column and type ={1;2} then Ctrl+Shift+Enter. The formula itself can't return an error but you're returning an array of two elements to 4 cells so Excel simply fills the rest with #N/A.
    Thank you. I just tried it. It reinforces what you, XOR LX and sixthsense have been saying. I still have much to learn. I hope it never ends.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] =if formula resistant to Sort a to z
    By taavilep in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-11-2014, 01:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1