+ Reply to Thread
Results 1 to 8 of 8

Help please with INDEX and MATCH

  1. #1
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Help please with INDEX and MATCH

    Hi all, I have something similar to this:

    sample.JPG

    And what I'm trying to do is have it so the blank cells under CODENAME become automatically populated with the correct codename from the table above.

    I have a pretty clunky formula that works one column at a time, but I figure there must be a way to have it search the entire range and return the right codename.

    NB I'm using Excel 2003 and wanting to avoid arrays, if possible. Sample worksheet attached.

    Cheers!
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Help please with INDEX and MATCH

    Is a VBA solution ok with you?
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  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,798

    Re: Help please with INDEX and MATCH

    No need for VBA, but you do need to set calculations to automatic (they are manual at present).

    =INDEX($D$8:$D$10,SUMPRODUCT(($E$8:$I$10=D14)*(ROW($D$8:$D$10)-7)))
    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
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Re: Help please with INDEX and MATCH

    That's brilliant! Thank you so much. Does exactly what I need it to do.

    Cheers!

  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,798

    Re: Help please with INDEX and MATCH

    Glad to help!

  6. #6
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Re: Help please with INDEX and MATCH

    A follow up question to this: supposing I look for an alias that isn't in the index - is there a way for it to return something like "FIXNAME" highlighting that I need to add it?

    I tried using ISERROR but I don't I think it recognizes the above situation as an error, instead it outputs the entire CODENAME column.

  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,798

    Re: Help please with INDEX and MATCH

    Because of your Excel version, I have fudged it a bit to keep the formula as short as possible:

    Excel 2016 (Windows) 32 bit
    D
    E
    F
    G
    H
    I
    6
    CODENAME Alias 1 Alias 2 Alias 3 Alias 4 Alias 5
    7
    FIX
    8
    ROBERT_Q Robert Robbie Bobby
    9
    STEVEN_H Steven Steve Stevo
    10
    MICHAEL_J Michael Mick Micky Mike Mikester
    11
    12
    13
    Alias CODENAME
    14
    Bob FIX
    15
    Steve STEVEN_H
    16
    Mick MICHAEL_J
    17
    Micky MICHAEL_J
    18
    Mike MICHAEL_J
    Sheet: Sheet1

    In E14 copied down:

    =INDEX($D$7:$D$10,IF(SUMPRODUCT(($E$7:$I$10=D14)*(ROW($D$7:$D$10)-6))=0,1,SUMPRODUCT(($E$7:$I$10=D14)*(ROW($D$7:$D$10)-6))))

    The text in D7 can be hidden by colouring it white.

  8. #8
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Re: Help please with INDEX and MATCH

    You're the best.

+ 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

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