+ Reply to Thread
Results 1 to 7 of 7

using IF, INDEX, and maybe MATCH together

  1. #1
    Registered User
    Join Date
    07-07-2018
    Location
    Philadelphia, PA, USA
    MS-Off Ver
    2016
    Posts
    3

    using IF, INDEX, and maybe MATCH together

    I'm trying to have create a function that will scan done of a range of cells, and if there's a match to a certain string or one of a number of strings,
    then it will put in the next column over a specific string.

    My gut tells me IF INDEX and MATCH will do the trick together.

    Is my reasoning wrong?

  2. #2
    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,689

    Re: using IF, INDEX, and maybe MATCH together

    No, it isn't, however, to confirm we'll need to see your workbook.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    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.

  3. #3
    Registered User
    Join Date
    07-07-2018
    Location
    Philadelphia, PA, USA
    MS-Off Ver
    2016
    Posts
    3

    Re: using IF, INDEX, and maybe MATCH together

    The Excel file's rather large, so here's a screen clip of the portion that should help.

    I just want to use the function to find a word that's in Col B and if it finds it,
    inserts a different word or two in Col C.

    I will use the function multiple times, changing the word it's looking for in Col B and what word to add in Col C each time.

    T?hanks!
    Attached Images Attached Images

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: using IF, INDEX, and maybe MATCH together

    So you have an incomplete list in column C and you need to fill in the blanks?

    Mid Sussex in column B always = West Sussex in column C?

    To do it without a lookup table, try this method

    ** Note that this will generate a circular reference error if there are consecutive blanks in column C with no correct match immediately above the first blank **

    On the assumption of no blank cells in column B, data starting in row 2.

    Select B2, Press Shift Ctrl Down, Shift Right, Tab, Shift Right. If done correctly, this will select all of the cells in column C , blank and non blank, where column B is completed.

    Press Ctrl g, click Special, Blanks, OK.

    Copy this fomula and paste it into the formula bar, then press Ctrl Enter, not just Enter!

    =IF(INDIRECT("R[-1]C[-1]",0)=INDIRECT("RC[-1]",0),INDIRECT("R[-1]C",0),IF(INDIRECT("R[1]C[-1]",0)=INDIRECT("RC[-1]",0),INDIRECT("R[1]C",0),""))

    Select C2, Press Shift Ctrl Down, Ctrl c, Ctrl Alt v, v, Enter to covert the formulas to text.

  5. #5
    Registered User
    Join Date
    07-07-2018
    Location
    Philadelphia, PA, USA
    MS-Off Ver
    2016
    Posts
    3

    Re: using IF, INDEX, and maybe MATCH together

    Correct, Column C is a incomplete list, several values in Column B will have the same value in Column C.

    There's about 48 different possibilities that will go into Column C based on the value in Column B; each value for Column C based on about 10 or so values in Column B.
    The Excel doc is about 400,000+ rows, so I'm trying to be sure before I put in the formula.
    I sort of figured I was going to do it manually 48 times or use a lookup table.

    I am trying to understand your formula as you have it there, but my gut tells me it's not going to work for my situation using that process, but I'm still going over it and trying to see.
    I may end up tweaking the formula some more.

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

    Re: using IF, INDEX, and maybe MATCH together

    if xlsx is too large to post use xlsb format (up to 9.77 MB) and try again
    Last edited by sandy666; 07-08-2018 at 03:38 PM.

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: using IF, INDEX, and maybe MATCH together

    Why not copy 100 or so rows to a new file for testing?

    The method that I suggested will apply the formula to the blank rows.

    For example, C10 is empty, If B9 and B10 are the same then the formula in C10 will copy whatever is in C9

    If B9 and B10 are not the same then the formula will look at B10 and B11, if they are the same then it will copy whatever is in C11 to C10.

    The formula will work with consecutive empty cells when a match is found in the row above, but not when it has to look at the row below.

+ 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