+ Reply to Thread
Results 1 to 6 of 6

How to get Index to search two different Columns

  1. #1
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    How to get Index to search two different Columns

    I have been using Index with small to pull out multiple lines from searching. however I am stuck. I have Dates in two columns I want to search from. Column A which is Starting Date and Column J which is End. I'm search purely by month. I want it to pull any reference with that month. So if
    5/1/13|A|B|1|6/1/13
    5/1/13|A|B|2|7/13/13
    6/1/13|A|B|3|8/4/13
    6/1/13|A|B|4|6/16/13

    So if i wanted the month of june these to show up
    5/1/13|A|B|1|6/1/13
    6/1/13|A|B|3|8/4/13
    6/1/13|A|B|4|6/16/13

    Is this possible?
    Last edited by LightHeart7; 10-31-2013 at 12:48 PM.

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: How to get Index to search two different Columns

    I don't understand:
    1) The layout of your sample data (what are those ||| things doing?),
    2) How INDEX(array, SMALL(other?_array, kth) ) works.
    3) How you want the output to display.

    Generally I think this will do what you want?:

    create a dummy column in K.
    K1 = OR( Month(A1) = 6, Month(J1) = 6)
    pull down
    Then filter column K for TRUE.

  3. #3
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Re: How to get Index to search two different Columns

    Sorry that was supposed to represent columns | | But i have a combobox that drops down showing each month. This is what I have just for one column month.
    Index(First, Small(IF(Date(,month(A1),)=Date(IF(Date(,Month(A3:A500),)Row(A3:A500)),Row(A1)

    AND/OR didn't seemed to work with me in this but maybe I placed it wrong?

  4. #4
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: How to get Index to search two different Columns

    can you maybe post an example spreadsheet?

    You've got at least two syntax errors in the INDEX() - a missing right paren and a missing comma, I think. AND it looks like it's an array formula? But even then I can't tell what your FALSE is trying to do?



    Also: row 2 in your example, starts in May and ends in August. Does that count as "something in June"?

    In that case you might want something like,
    K1 = AND( Month(A1) >= 6, 6 <= Month(J1) )

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to get Index to search two different Columns

    Arrayed functions don't like AND and OR. Instead use + for OR and * for AND. See my example attached. I am returning column F if the month in A or E is June. The formula I used is
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Does that help?
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  6. #6
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Re: How to get Index to search two different Columns

    Good to know! Thanks! I struggled for hours with that And and Or in that. Thank you so much!

+ 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] Using Index & Match to search 2 vertical columns and return data to a vertical set
    By QuietLife in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-08-2013, 09:59 AM
  2. Increment columns in INDEX and MATCH formula - ROWS and COLUMNS
    By nickmangan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2012, 10:38 AM
  3. Using Index Match to search multiple columns
    By myshadeofglory in forum Excel General
    Replies: 15
    Last Post: 05-30-2012, 11:53 AM
  4. Using Search, Index, Lookups, Etc.
    By JasonBarnes in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-22-2011, 10:15 AM
  5. Index and Match-search across mutliple columns
    By satkadeb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-11-2008, 03:20 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