+ Reply to Thread
Results 1 to 28 of 28

Index & Match - Need particular given text to arrive from a range

  1. #1
    Registered User
    Join Date
    11-15-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    12

    Index & Match - Need particular given text to arrive from a range

    =IFERROR(INDEX($K$1:$AA$1,MATCH("Z",K3:AA3)),"YTS")

    In the above Index-Match function, I wanted to Index a value from K1:AA1 by Matching and finding the final text value from K3:AA3. However, I want to exclude cells T3:V3.

    If I use the following, I get result only upto K3:S3, ie., it does not include the result from W3:AA3. Please suggest a solution.
    =IFERROR(INDEX($K$1:$S$1,MATCH("Z",K3:S3)),INDEX($W$1:$AA$1,MATCH("z",W3:AA3),"YTS"))

    File attached for review.
    Attached Files Attached Files
    Last edited by AliGW; 11-15-2017 at 02:04 AM. Reason: To explain my issue properly

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Index & Match

    Explain it well what is your expected result and what is your thought how can it done?
    Last edited by AliGW; 11-15-2017 at 02:05 AM. Reason: OP has amended title.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Index & Match - Need particular given text to arrive from a range

    Try this:

    =IFERROR(INDEX($A$1:$AA$1,MAX(LOOKUP(2,1/(K3:S3<>""),COLUMN(K:S)),LOOKUP(2,1/(W3:AA3<>""),COLUMN(W:AA))),"YTS")
    Last edited by AliGW; 11-15-2017 at 02:25 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    11-15-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    12

    Re: Index & Match

    Dear Mr. Shukla,

    Thanks for the suggestion. I have updated the Title now. I need to get the answer at cell F3 which should be "Imp/IA" instead of "Trg" because in the formula (given below), I have selected range K1:S1 & W1:AA1 and excluded T3:V3. In the formula below, I am getting result beyond S3. Please suggest.
    =IFERROR(INDEX($K$1:$S$1,MATCH("Z",K3:S3)),INDEX($W$1:$AA$1,MATCH("z",W3:AA3),"YTS"))

    Hope I am clear now.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Index & Match - Need particular given text to arrive from a range

    See post #3.

  6. #6
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Index & Match - Need particular given text to arrive from a range

    Quote Originally Posted by AliGW View Post
    Try this:

    =IFERROR(INDEX($A$1:$AA$1,MAX(LOOKUP(2,1/(K3:S3<>""),COLUMN(K:S)),LOOKUP(2,1/(W3:AA3<>"")),COLUMN(W:AA))),"YTS")
    Superb Ma'am, I liked it very much very easily handle the arguments but parentheses which closed in second lookup and lookup array wrongly.


    =IFERROR(INDEX($A$1:$AA$1,MAX(LOOKUP(2,1/(K3:S3<>""),COLUMN(K:S)),LOOKUP(2,1/(W3:AA3<>"")),COLUMN(W:AA))),"YTS")

    It should be as below.

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

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Index & Match - Need particular given text to arrive from a range

    Well spotted - now amended.

  8. #8
    Registered User
    Join Date
    11-15-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    12

    Re: Index & Match - Need particular given text to arrive from a range

    No, both solutions do not resolve my query. Please check it again by deleting my entries from K3 to Q3. This results in "YTS" which is wrong because U3 is has an entry, eg. "Fin". This means that your solution does not take count beyond S3. Please suggest new solution again.

  9. #9
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Index & Match - Need particular given text to arrive from a range

    ok it can refine with iferror formula

    Give try

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

  10. #10
    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: Index & Match - Need particular given text to arrive from a range

    I may have interpreted incorrectly.

    Try array entering this formula. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  11. #11
    Registered User
    Join Date
    11-15-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    12

    Re: Index & Match - Need particular given text to arrive from a range

    Thanks a lot Ms. Ali, Mr. Shukla and Mr. Flame. Finally, I got the answer. Thank you all again...

  12. #12
    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: Index & Match - Need particular given text to arrive from a range

    This is shorter that my previous. Still array entered.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Index & Match - Need particular given text to arrive from a range

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  14. #14
    Registered User
    Join Date
    11-15-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    12

    Re: Index & Match - Need particular given text to arrive from a range

    Sorry, I noted two more errors as follows:
    1. I get "0" (zero) instead of "YTS" if I delete all entries from K3:AA3 when I use the following formula. Please note "YTS" is given at the end of the formula.
    2. Please note that I use Dates in alternate columns, for eg., L3, N3, etc. When I enter a date, this formula does not work, ie., the result at F3 become "0". Therefore, this formula works only when I remove all dates from cells. To know yourself, please enter any date at N3 in the Excel sheet attached in my first post.

    =IFERROR(INDEX($A$1:$AA$1,MAX(IFERROR(LOOKUP(2,1/(K3:S3<>""),COLUMN(K:S)),0),IFERROR(LOOKUP(2,1/(W3:AA3<>""),COLUMN(W:AA)),0))),"YTS")

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Index & Match - Need particular given text to arrive from a range

    I provided a solution based on the sample data you gave. In future, please provide REALISTIC sample data. I am afraid I do not have time to look at this now, as I am busy.

  16. #16
    Registered User
    Join Date
    11-15-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    12

    Re: Index & Match - Need particular given text to arrive from a range

    Dear Ms. Ali,

    Sorry for not giving an complete Excel sample earlier. Now, attached the sheet with the formula given by you and also added the dates in the respective cells. As of now, the answer is "0" at F3. Once we remove all dates in the row, the result will be as I wish. Sorry again. Please make corrections.
    Attached Files Attached Files

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Index & Match - Need particular given text to arrive from a range

    As I said above, I am not able to help at the moment - sorry.

  18. #18
    Registered User
    Join Date
    11-15-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    12

    Re: Index & Match - Need particular given text to arrive from a range

    Ok... No problem. You can provide the solution when you are at leisure. However, I want to suggest you one more point that the formula may yield correct result if it 'look' or 'match' the 'maximum' 'text' value in the row.

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Index & Match - Need particular given text to arrive from a range

    Thank you - that's very kind of you.

    A propos, you seem to have an idea of how to make this work yourself - did you try tweaking my suggested formula? If so, how did you get on?

  20. #20
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Index & Match - Need particular given text to arrive from a range

    This is a long-winded thread. Please explain what you want in F3 and WHY the expected result is zero. It's hard to tell what you want, just by looking at a fromula that does not provide the desired result. A few rows of data WITH A CLEAR EXPLANATION would be MUCH more helpful than just one row.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  21. #21
    Registered User
    Join Date
    11-15-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    12

    Re: Index & Match - Need particular given text to arrive from a range

    Dear AliGW,

    Yes, I tried tweaking your suggestion and found that there seems to be two things need change.
    1. If there is no entry in the range K3:AA3, then the formula should yield "YTS" which condition is set at the end of the formula.
    2. In the above range K3:AA3, when we enter dates in the alternate cells like L3, N3, etc., we get the result at F3 as "0" which is wrong. I found that my earlier suggestion to you about finding the maximum "Text" value is not correct because your formula accepts even dates. However, I found that the formula accepts date until P3 and the required result being arrived at F3. But, when we add date at R3, F3 become "0". I think the Lookup for MAX value in the formula looks up to K3:S3 only, not beyond.

    Your formula appended below for your review again and I have attached the worksheet again with dates added up to R3. If we remove the date from R3, our preferred result arrives.
    =IFERROR(INDEX($A$1:$AA$1,MAX(IFERROR(LOOKUP(2,1/(K3:S3<>""),COLUMN(K:S)),0),IFERROR(LOOKUP(2,1/(W3:AA3<>""),COLUMN(W:AA)),0))),"YTS")

    Thank you again for your interest in taking up my issue.
    Attached Files Attached Files

  22. #22
    Registered User
    Join Date
    11-15-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    12

    Re: Index & Match - Need particular given text to arrive from a range

    Dear Glenn,

    My expected result from the attached worksheet is:

    I have a range K3:AA3 wherein if I fill in the cells with a status and its completed date, the formula should find the maximum position of the entry in the range and Index a corresponding value from the range K1:AA1 and place the result at F3. For example, If the last entry in K3:AA3 is at Q3, then the formula should Index result from Q1 (corresponding Cell above the Max position) at F3. However importantly, I would like the formula to exclude the range T3:V3 from Lookup/Match.

    And, if there is no entry in any of the cells in the range K3:AA3, then the result at F3 should be YTS.

    I have attached the worksheet for your review.
    Attached Files Attached Files

  23. #23
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Index & Match - Need particular given text to arrive from a range

    Try

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

  24. #24
    Registered User
    Join Date
    11-15-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    12

    Re: Index & Match - Need particular given text to arrive from a range

    Dear Mr. Shukla,

    Yes, it works fine but a small update is needed that when there are no values in the range K3:AA3, then the result should be YTS in F3. This condition is already laid in your formula, but does not work now. Please update.

  25. #25
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Index & Match - Need particular given text to arrive from a range

    Try

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

  26. #26
    Registered User
    Join Date
    11-15-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    12

    Re: Index & Match - Need particular given text to arrive from a range

    Dear Mr. Shukla,

    Thanks a lot. This works exactly... However, I wonder as to why when a simple INDEX/MATCH formula (given below) can resolve this issue, just excluding T3:V3 needs a complicated formula (since I am novice) like yours and AliGW's. Could you please explain this. Then, I will close this thread "Solved". I just wanted to learn .
    =IFERROR(INDEX($K$1:$AA$1,MATCH("Z",K3:AA3)),"YTS")

  27. #27
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Index & Match - Need particular given text to arrive from a range

    You've answered this question yourself - it's because you want to exclude a range. Excel cannot guess what you want it to do unless you tell it. The solutions you have been offered require slightly longer formulae to allow for that exclusion, but are not in themselves particularly complicated.

  28. #28
    Registered User
    Join Date
    11-15-2017
    Location
    India
    MS-Off Ver
    2007
    Posts
    12

    Re: Index & Match - Need particular given text to arrive from a range

    Thanks a lot Ms. AliGW and Mr. Shukla for your excellent support...

+ 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+MATCH instead of VLOOKUP+MATCH, why is INDEX a better choice and how to re-write?
    By Renejorgensen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2016, 10:54 AM
  2. [SOLVED] Index / Match - match 3 input values and return the results from the index
    By t83357 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2016, 07:34 PM
  3. [SOLVED] Match-Index in stead of Index-Match lookup Array among Arrays
    By Numnum in forum Excel General
    Replies: 2
    Last Post: 10-15-2015, 02:08 PM
  4. INDEX MATCH MATCH/OFFSET MATCH MATCH with named ranges
    By Andrew-Mark in forum Excel General
    Replies: 3
    Last Post: 02-27-2015, 10:56 PM
  5. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  6. Replies: 6
    Last Post: 11-08-2013, 10:29 PM
  7. Replies: 3
    Last Post: 05-02-2013, 01:31 AM

Tags for this Thread

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