+ Reply to Thread
Results 1 to 10 of 10

Return a column of values based on 2 way search

  1. #1
    Registered User
    Join Date
    03-01-2013
    Location
    Canberra Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Return a column of values based on 2 way search

    Ref the attachment. Using an xml feed button a column of values with a count between 4 and 6 is returned at Col A Range A2:A7. There is a count of the values at cell D4. I need a formula at B2 to look up the three tables for columns with either 4, 5 or 6 values, then H lookup within the appropriate table the parameter column that matches the value of the cell at A2.

    From the example: the count is '4' values, so the table we're interested in is A11:D16. The value of A2 is '2.2' so the column with the label '>2 to 3' is the correct column. Therefore the values in the range C13:C16 are returned to B2.

    I could solve this problem if I wanted to return a single value as a result of 2 criteria, but not sure how to return a column of values.

    Much appreciate your interest.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-01-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Return a column of values based on 2 way search

    hi..

    please check..

    regards,

  3. #3
    Registered User
    Join Date
    03-01-2013
    Location
    Canberra Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Red face Re: Return a column of values based on 2 way search

    Not quite sir. If you type '1' followed by a set of 3 following numbers down the column, it returns the Range B13:B16. That column is for numbers >1. It should return the Range A13:A16.

    But you've nearly solved it, well done!

  4. #4
    Registered User
    Join Date
    07-01-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Return a column of values based on 2 way search

    ups...
    sorry..

    please change formula on B2 as below.
    "IFERROR(INDEX((OFFSET($A$13,0,($D$4-4)*4):OFFSET($A$13,3+($D$4-4),3+(($D$4-4)*4))),ROW()-1,MATCH(ROUNDUP($A$2,0),{1,2,3,4},0)),"")"
    and copied down.

    regards,

  5. #5
    Registered User
    Join Date
    03-01-2013
    Location
    Canberra Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Return a column of values based on 2 way search

    I'm getting an error message now, I've rechecked that the formula is verbatim 3 times. Would you mind editing the spreadsheet with the new amendment and resending.
    Cheers

  6. #6
    Registered User
    Join Date
    07-01-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Return a column of values based on 2 way search

    please check.

  7. #7
    Registered User
    Join Date
    03-01-2013
    Location
    Canberra Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Return a column of values based on 2 way search

    Sweet as! Thankyou so much. In your previous post you had an '*' before MATCH, which was causing the problem.

    Cheers again.

  8. #8
    Registered User
    Join Date
    03-01-2013
    Location
    Canberra Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Cool Re: Return a column of values based on 2 way search

    Quote Originally Posted by JR DHONA View Post
    please check.
    To JR Dhona or anyone else interested,

    You did well with that simplified sample I provided, but I am having trouble interpreting your formula to apply to a real world exercise. I have attached a smaller version of my current workbook. There are some changes that affect the way your solution worked. Namely:
    1/ The first column of each Count # table varies from <=1.5 for Counts 6 & 7, then increases to <=2 for Count 8
    2/Similarly the Max column label is >3 for Counts 6 & 7, but increases to >3.5 for Count 8
    3/The syntax <=3 or >3 has to be followed exactly and no value "Rounded"
    4/Each Count # table always comprises 5 column headings. In reality the Count # tables start at 6 and go through to 10 with 5 columns to each table, a total of 25 columns.

    Thanking you for your consideration.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    03-01-2013
    Location
    Canberra Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Red face Re: Return a column of values based on 2 way search

    I was able to solve my own conundrum.
    I just needed a nested IF AND formula to categorize the Parameter. This gave me two distinct criteria to MATCH
    Then inverted the Table so the offset worked on columns, not rows.
    Renamed the Parameters so they couldn't be returned as text in the IF AND formula.

    Works a treat now!
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    07-01-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Return a column of values based on 2 way search

    dear peasther,

    sorry just reply..
    thank you for sharing.
    for some case,
    we learn that change the layout of data is the best solutions.

    regards,

+ 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. Replies: 4
    Last Post: 12-21-2012, 10:35 AM
  2. [SOLVED] Return the lowest value in one column based on a text search in a different column.
    By Juliana33 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-11-2012, 09:58 AM
  3. Search column, return values in adjacent column?
    By HELPME13 in forum Excel General
    Replies: 3
    Last Post: 10-01-2010, 11:17 AM
  4. Search column and return values
    By inzain in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-23-2009, 11:23 AM
  5. Replies: 3
    Last Post: 01-10-2006, 06:10 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