+ Reply to Thread
Results 1 to 12 of 12

Array formula does not return consistent result

  1. #1
    Registered User
    Join Date
    06-05-2017
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    6

    Question Array formula does not return consistent result

    Hello - I am new to the forum and would like your help on an array formula:

    It works in one case but not the next, I'm not sure why?

    =IFNA(INDEX(Names!$BE$3:$BE$7514,MATCH(A5&W5&0&1,Names!$H$3:$H$7514&Names!$G$3:$G$7514&Names!$BB$3:$BB$7514&Names!$BF$3:$BF$7514,0)),"")
    (This is entered as an array)

    For the first result in Y4 it returns "1" which is correct, but for the next line item it returns "1" as well which is incorrect. It should return "blank" but is not. There are four parameters that it should be looking at. Y5 should return "blank" since Barley Flats does not exist in 'Names' column H.

    Thanks for your help!
    Attached Files Attached Files

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

    Re: Array formula does not return consistent result

    Hi knowleqe. Welcome to the forum.

    After concatenation with empty cells "Barley Flats01" does indeed match at row 1426. MATCH returns 1424. This is relative to row 3 (the first row of the range(s). Factoring for the ranges starting at row 3 (Names!$BE$3:$BE$7514) is absolute row 1426.

    Type BE1426 in the name drop down box and hit enter. There is a 1 there.

    Am I missing something?
    Last edited by FlameRetired; 06-05-2017 at 06:57 PM. Reason: Wrong row numbers.
    Dave

  3. #3
    Registered User
    Join Date
    06-05-2017
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    6

    Re: Array formula does not return consistent result

    Quote Originally Posted by FlameRetired View Post
    Hi knowleqe. Welcome to the forum.

    After concatenation with empty cells "Barley Flats01" does indeed match at row 1426. MATCH returns 1424. This is relative to row 3 (the first row of the range(s). Factoring for the ranges starting at row 3 (Names!$BE$3:$BE$7514) is absolute row 1426.

    Type BE1426 in the name drop down box and hit enter. There is a 1 there.

    Am I missing something?
    Thanks Dave - yes, Barley Flats matches in 'Names!'G1426 but not in 'Names!'H1426. That is why I expect it to return a "blank" value whereas for "Abbey", it does find a match in column H and returns "1". The formula is working for many other rows but for some reason it is not on these select Names in column A. All values are text in both tabs, maybe I could be missing something?

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

    Re: Array formula does not return consistent result

    yes, Barley Flats matches in 'Names!'G1426 but not in 'Names!'H1426.
    Contatenating 'Names!'H1426&'Names!'G1426&'Names!'BB1426&'Names!'BF1426 returns "BARLEY FLATS01" the same as if there were no 'Names!'H1426.

    I've re uploaded the file. I've hidden all but the relevant columns in 'Names' to make it easier to follow what I mean. Row 1426 is highlighted yellow.

    If this is not what you are expecting perhaps you need additional criteria in your formula? Since I don't know the overall objectives I really can't advise on that.

    Let me know if this helps.

  5. #5
    Registered User
    Join Date
    06-05-2017
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    6

    Re: Array formula does not return consistent result

    Quote Originally Posted by FlameRetired View Post
    Contatenating 'Names!'H1426&'Names!'G1426&'Names!'BB1426&'Names!'BF1426 returns "BARLEY FLATS01" the same as if there were no 'Names!'H1426.

    I've re uploaded the file. I've hidden all but the relevant columns in 'Names' to make it easier to follow what I mean. Row 1426 is highlighted yellow.

    If this is not what you are expecting perhaps you need additional criteria in your formula? Since I don't know the overall objectives I really can't advise on that.

    Let me know if this helps.
    Thanks for hiding the blank cells Dave, makes it easier I thought since looking up Barley Flats in column H is the first criteria and that failed, it would return blank? Otherwise keep looking at the next parameters. That's why I think the array is inconsistent since "Abbey" is found in 'Names!'H:H and returns "1" but "Whitworth" and "Whizzin" return "blank" since they are not in 'Names!'H:H.

    "Barley Flats", "Whitworth", and "Whizzin" should return "blank" but not sure why that isn't the case.

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

    Re: Array formula does not return consistent result

    It appears that in column W Barley Flats et. al. have already been tested against column H. That is why they return "blanks". They aren't there.

    Overall it looks to me like your formula is working properly.

    Otherwise keep looking at the next parameters. That's why I think the array is inconsistent since "Abbey" is found in 'Names!'H:H and returns "1" but "Whitworth" and "Whizzin" return "blank" since they are not in 'Names!'H:H.
    Yes, and "Whitworth01" and "Whizzin01" won't match because "Whitworth00" and "Whizzin00" are the results of the concatenation in Names!$H$3:$H$7514&Names!$G$3:$G$7514&Names!$BB$3:$BB$7514&Names!$BF$3:$BF$7514. It begins to appear that the problems may lie in column BF. Is there any chance some of the 1s and 0s are typos in that column?
    Last edited by FlameRetired; 06-05-2017 at 09:17 PM. Reason: Afterthoughts

  7. #7
    Registered User
    Join Date
    06-05-2017
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    6

    Re: Array formula does not return consistent result

    Quote Originally Posted by FlameRetired View Post
    It appears that in column W Barley Flats et. al. have already been tested against column H. That is why they return "blanks". They aren't there.
    Yes, I agree. This is where I'm not seeing why the formula is returning "1". Because 'Barley Flats' is the first value the concatenation would be "Barley Flats01" but that's not an option in Names!$H$3:$H$7514&Names!$G$3:$G$7514&Names!$BB$3:$BB$7514&Names!$BF$3:$BF$7514.

    Quote Originally Posted by FlameRetired View Post

    Overall it looks to me like your formula is working properly.

    Yes, and "Whitworth01" and "Whizzin01" won't match because "Whitworth00" and "Whizzin00" are the results of the concatenation in Names!$H$3:$H$7514&Names!$G$3:$G$7514&Names!$BB$3:$BB$7514&Names!$BF$3:$BF$7514. It begins to appear that the problems may lie in column BF. Is there any chance some of the 1s and 0s are typos in that column?
    If "Whitworth01" and "Whizzin01" won't match since neither of those strings (Whitworth and Whizzin respectively) are in column H, why does Barley return a value? Apologies if I am coming across as dense, but I thought the array should test the first result then the first ampersand then the second and so on. If the logic is saying, "if 'Whitworth & 0 & 1' " I can see your train of thought but "Barley Flats" still isn't in Names!H:H. From my understanding I am asking, "return the value in 'Names'!$BE3:$BE7514 if value in 'Analysis!A5 matches 'Names'!$H3:$H7514 & 0 in 'Names'!$BB3:$BB7514 & 1 in 'Names'!$BF3:$BF7514.

    There shouldn't be typos in that column, the formula was =if(cell reference="Tie",1,0). All the cell references were either blanks, Tie, or End.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,942

    Re: Array formula does not return consistent result

    knowleqe welcome to the forum

    Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding

    For normal conversational replies, try using the QUICK REPLY box below.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  9. #9
    Registered User
    Join Date
    06-05-2017
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    6

    Re: Array formula does not return consistent result

    Sure thing Ford!

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

    Re: Array formula does not return consistent result

    but I thought the array should test the first result then the first ampersand then the second and so on.
    No. There are no tests in your formula. Tests require functions / operators that test TRUE / FALSE. What your formula does is instruct Excel to concatenate a string build unconditionally. Then it instructs Excel to MATCH that to an array of other concatenated strings (built unconditionally).

    If the intent is to concatenate conditionally that requires a different formula.

    Also the only match for Barley Flats that can return a 0 is Barley FlatsVERDUGO01. (row 2379) Even if all the tests you list were imposed I am still puzzled by the expectation of a 0 return.

    Having said all that I will hazard a guess. Try entering this array formula in Y4 of 'Analysis'.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This coerces a 0 if there are no matches in H:H.

  11. #11
    Registered User
    Join Date
    06-05-2017
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    6

    Re: Array formula does not return consistent result

    Thanks Dave for all your suggestions so far! Thanks for the clarification about the ampersand with it just joining the strings together. What do you mean by unconditionally? Is that to say that "Barley Flats01" is the same as "0Barley Flats1"?

    I think we may be talking past each other...

    Since 'Barley Flats' is the first value the concatenation would be "Barley Flats01" but that's not an option in Names!$H$3:$H$7514&Names!$G$3:$G$7514&Names!$BB$3:$BB$7514&Names!$BF$3:$BF$7514. I thought the first match value is measured against the first range, the second match value the second range, and so forth? That's why I keep going back to "Barley Flats" is not found in Names!$H3:H514. Is that correct?

    From my understanding I am asking, "return the value in 'Names'!$BE3:$BE7514 if value in 'Analysis!A5 matches 'Names'!$H3:$H7514 & 0 in 'Names'!$BB3:$BB7514 & 1 in 'Names'!$BF3:$BF7514.

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

    Re: Array formula does not return consistent result

    I thought the first match value is measured against the first range, the second match value the second range, and so forth? That's why I keep going back to "Barley Flats" is not found in Names!$H3:H514. Is that correct?
    No. It doesn't work that way.

    There is no order of matching as you describe.
    It just builds strings. MATCH treats those exactly the same as if "Barley Flats01" and others were in single cells.

    What do you mean by unconditionally? Is that to say that "Barley Flats01" is the same as "0Barley Flats1"?
    No

    When I say unconditionally I mean there is no "IF(condition,do this,else do this other thing)" implied in concatenation. Concatenating only instructs Excel to "do this" (build the string) without qualification (unconditionally).

    In order to do what you're understanding is ("first match value against first range ....") you would need to insert some kind of IF condition(s) into your formula. In other words build the strings (concatenate) conditionally.

    That's where I get confused. Even if you were to define conditions I see no where to go with them in the INDEX/MATCH because the returns you expect are not possible with the data you have. There are no 0s in BE that meet requirements.

    As I understand you in order to return 0s they need to be coerced. That is why I suggested the formula I did. It is all I could think of if we were "talking past on another" as you say.

    Did you try the formula I suggested? It produces the output you describe, but not in the way the rest of your formula and comments suggest you want it to do.

    Since 'Barley Flats' is the first value the concatenation would be "Barley Flats01" but that's not an option in Names!$H$3:$H$7514&Names!$G$3:$G$7514&Names!$BB$3:$BB$7514&Names!$BF$3:$BF$7514.
    Yes it is. Try filtering Barley Flats in 'Names'

    (I concatenated each H:H&G:G&B:B&BF:BF in column BG to illustrate.)

    Row\Col
    G
    H
    BB
    BC
    BD
    BE
    BF
    BG
    826
    BARLEY FLATS
    0
    1
    1
    1
    0
    BARLEY FLATS00
    1425
    BARLEY FLATS
    0
    1
    0
    1
    0
    BARLEY FLATS00
    1426
    BARLEY FLATS
    0
    0
    1
    1
    1
    BARLEY FLATS01
    1427
    BARLEY FLATS
    RAVINE
    0
    0
    0
    1
    1
    RAVINEBARLEY FLATS01
    2379
    BARLEY FLATS
    VERDUGO
    0
    0
    0
    0
    1
    VERDUGOBARLEY FLATS01
    Last edited by FlameRetired; 06-07-2017 at 09:27 AM.

+ 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] Index and match (compare and return). Not consistent
    By pmw19800 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-26-2017, 04:08 PM
  2. [SOLVED] same result without array formula?
    By Kanuck in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-05-2017, 10:41 PM
  3. Replies: 3
    Last Post: 08-06-2009, 04:27 AM
  4. needing to find largest value in array, then return entire row associated with result
    By Phraedrique in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-15-2009, 12:32 PM
  5. Advanced formula - Return result & Show Cell Reference of result
    By Irv in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-05-2006, 10:40 PM
  6. return array result in cell based on comparing dates
    By Ruthki in forum Excel Formulas & Functions
    Replies: 51
    Last Post: 09-06-2005, 12:05 PM
  7. Replies: 5
    Last Post: 04-04-2005, 05:06 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