+ Reply to Thread
Results 1 to 7 of 7

INDEX with conditions

  1. #1
    Registered User
    Join Date
    03-05-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    21

    INDEX with conditions

    Hi

    I'm getting a bit mixed up with my conditions whilst indexing.

    I have enclosed the sample data. Basically my indexing function is working on sheet2 to pull the date from a list of orders into a client matrix. I was hoping to add a condition of "=Y" from the column D (Repeat Order) on the Orders sheet.

    I have tried various combinations and am now loseing my way (and my hair). Can anyone help?
    Attached Files Attached Files

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: INDEX with conditions

    Try this array formula with added "Y" condition

    =IFERROR(INDEX(Orders!$A:$A,SMALL(IF(Orders!$B$2:$B$23=$A2,IF(Orders!$D$2:$D$23="Y",ROW(Orders!$B$2:$B$23))),COLUMNS($B2:B2))),"")


    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Registered User
    Join Date
    03-05-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: INDEX with conditions

    Interesting. This is similar to my inital thoughts however I was finding the value did'nt change when a "N" was added.

    The purpose of formula if to eradicate those clients who just had repeat orders, thereby leaving a list of only new clients who then go on to repeat order.

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: INDEX with conditions

    Did the formula work?

  5. #5
    Registered User
    Join Date
    03-05-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: INDEX with conditions

    Gave it another go on a different dataset and it worked great. When I originally did this I used ,"=Y" (do you know why this wouldn't work?

    Thanks for the help anyway.

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: INDEX with conditions

    Thank you for the feedback

    BTW, the values do change if you change "Y" to "N". Also you may want to set a cell where you can switch between Y/N and have a formula set to this cell. In addition, to get unique Company Names you can use this formula in A2

    No need for helper column and this formula does not require Ctrl+Shift+Enter confirmation.

    =IFERROR(INDEX(Orders!$B$2:$B$23,MATCH(0,INDEX(COUNTIF($A$1:A1,Orders!$B$2:$B$23),,),)),"")



    Please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools-> Mark thread as Solved).

  7. #7
    Registered User
    Join Date
    03-05-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: INDEX with conditions

    Thanks AlKey.

    Nice tip for removing the column. No point in going round the houses when a motorway (thats what we call a highway) runs through the middle of it

+ 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 on 3 conditions
    By shiftyspina in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-17-2013, 11:56 PM
  2. Add Conditions in Index-Match
    By foncesa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-01-2013, 01:21 AM
  3. Index/Match with Conditions and Duplicates
    By ddapcn in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-09-2012, 03:50 AM
  4. Index Match with conditions
    By vblackman in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-19-2012, 01:14 PM
  5. Excel 2007 : INDEX LARGE with two conditions.
    By jvelez198 in forum Excel General
    Replies: 2
    Last Post: 02-20-2012, 08:26 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