+ Reply to Thread
Results 1 to 6 of 6

Index Reference Formula using Search Term

  1. #1
    Registered User
    Join Date
    02-16-2015
    Location
    California
    MS-Off Ver
    Excel for Mac 2011 V 14.4.7
    Posts
    31

    Index Reference Formula using Search Term

    Hello everyone,

    Brand new to this forum. Thanks in advance for any help you can provide.

    In the attached file, I have a "CC Summary" tab (in yellow) that summarizes my "Details" tab (in blue). In the "CC Summary" tab, I have a drop down cell that allows me to cycle through various cost centers.

    In "CC Summary," column L, I'm trying to have column L change data based upon the cost center that's selected in A1. And the only data I want to display in column L are line items from "Details" that contain the characters "TBH" or preferably "*TBH" - see column P for the desired result. This would show me any open jobs available for that cost center and leaves out other line item detail not related to headcount.

    I've gotten as far as I can on my own with this. My problem right now is that the formula I have is returning all lines. Additionally, once I do get this formula working, ideally, there would be no blank rows - all data relevant to the selection would rise to the first data return in cell L5.

    I am intentionally trying to avoid Macros, VB & Pivot Tables to solve this problem.


    My poor attempt at his formula is below (and also in the file starting at L5 on "CC Summary":

    =IF(ISERROR(SMALL(IF(IF(ISERROR(SEARCH($A$2,DETAILS!B:B)),FALSE,TRUE),ROW(DETAILS!B:B)),ROW(DETAILS!I:I))),"",INDEX(DETAILS!B:I,SMALL(IF(IF(ISERROR(SEARCH(TBH,DETAILS!I:I)),FALSE,TRUE),ROW(DETAILS!B:B)),ROW(DETAILS!I:I)),8))
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Index Reference Formula using Search Term

    Hi, welcome to the forum

    Try this ARRAY formula....
    =IFERROR(INDEX(DETAILS!$I$6:$I$154,SMALL(IF((DETAILS!$B$6:$B$154=$A$2)*(MID(DETAILS!$I$6:$I$154,2,3)="TBH"),ROW(DETAILS!$A$6:$A$154)-5),ROWS($A$1:A1))),"")

    ...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.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    02-16-2015
    Location
    California
    MS-Off Ver
    Excel for Mac 2011 V 14.4.7
    Posts
    31

    Re: Index Reference Formula using Search Term

    Beautiful, thank you!!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Index Reference Formula using Search Term

    Happy to help, thanks for the feedback

  5. #5
    Registered User
    Join Date
    02-16-2015
    Location
    California
    MS-Off Ver
    Excel for Mac 2011 V 14.4.7
    Posts
    31

    Re: Index Reference Formula using Search Term

    Okay, bringing this thread back up to the top. Over the past several months, this formula has been working great to quickly organize massive amount of data and tell a story. Last week however, the data started to return an untraceable error. I believe the error is related to the "Org" which is the reference criteria.

    In the image below, the exact formula is being used in two sections. The section on the left is using the "Cost center" as the reference to pull data. The section on the right is using the "Org" as the reference to pull data. I've highlighted the "Org" sections cell so you can see the formula bar. This formula is the exact same for the "Cost Center" section, with the only change being the reference cell is $J$10 instead of $V$10 and the range for the cost center is $B instead of $A (Org) - the range is on the far right of the image (columns A & B).

    Prior to last week, both sections (Cost Center TBH's & Org TBH's) were working perfectly. But now, only Cost Center section is working and Org is not. I've played around with the formula in the Org section to try to isolate where the problem is. I believe the issue might be something in the Org criteria & range. I checked to make sure there are no extra or missing digits (spaces) and I checked to ensure that the cell format for the reference is the same as the cell format in my range.

    Note: J10 & V10 are drop down menus and there are multiple cost centers and orgs, so don't be concerned that you are seeing IS700 in V10 and IS300 in the range. This image is only showing a portion of all the data.

    Thanks in advance for your help.

    Screen Shot 2015-08-10 at 9.54.31 PM.png

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Index Reference Formula using Search Term

    That is a very small pic, and we cant really work with pics, anyway I suggest that you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

+ 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. Keyword search and copy row to new sheet: search term problem
    By completenovice in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2014, 11:32 AM
  2. Replies: 3
    Last Post: 04-01-2014, 05:54 PM
  3. Replies: 2
    Last Post: 03-17-2014, 04:19 PM
  4. [SOLVED] Formula to display cell if the text content partially matches a search term
    By Avestron in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-11-2013, 04:07 AM
  5. Replies: 3
    Last Post: 07-12-2006, 10:15 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