+ Reply to Thread
Results 1 to 14 of 14

hlookup or index/match

  1. #1
    Forum Contributor
    Join Date
    04-29-2012
    Location
    nuneaton, England
    MS-Off Ver
    Office 365
    Posts
    370

    hlookup or index/match

    Hi all,

    i have 2 dilemmas

    **dilemma 1**

    i have a date of purchase in column A
    i have a customer number in column B

    now if i want to search for a date and for it to display the results from columns C,D,E and F (purchased items) i know i use HLOOKUP

    same if i want to search for customer number,

    but how would i look for a customer and a date at the same time.

    **dilemma 2**

    i want to be able to put in a customer number and excel to tell me all the dates they purchased items.

    currently i use

    ={IFERROR(INDEX(Table1[DATE],SMALL(IF(Table1[NUM]=$L$3,ROW(Table1[NUM])-MIN(ROW(Table1[NUM]))+1),ROWS($1:1))),"error")}

    and i change the ROWS($1:1) to ROWS($1:2) or ROWS($1:3) etc

    to bring in that result, but i want it to bring in unique dates, as a customer might ring us back with another purchase on the same date and i dont want it to duplicate the date.


    hope that makes sense..lol

  2. #2
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: hlookup or index/match

    Hi try this
    =index(A:A,match(C1,B:B,0))
    B:B represents customer Number
    A:A Date of purchase column
    C1 is required customer number
    Punnam

  3. #3
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: hlookup or index/match

    Hi,

    Can u post a workbook with sample data (containing insensitive data) and results (how your output should look like) expected out of your source ?
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  4. #4
    Forum Contributor
    Join Date
    04-29-2012
    Location
    nuneaton, England
    MS-Off Ver
    Office 365
    Posts
    370

    Re: hlookup or index/match

    i can post example, but it might take a while do edit... tbh, the customer is a patients hospital number and the purchase is a sterile equipment id number.. but i wrote it the way i did to make it easier to understand.

  5. #5
    Forum Contributor
    Join Date
    04-29-2012
    Location
    nuneaton, England
    MS-Off Ver
    Office 365
    Posts
    370

    Re: hlookup or index/match

    here is an example
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: hlookup or index/match

    Your data looks interesting. Do you only want to return the first occurrence, it seems like numbers just move out one tray as the occurrence increases.
    Attached Files Attached Files
    Despite the high cost of living, it remains very popular.

    Don't forget to mark threads SOLVED when you get an answer and rep all the geniouses that helped you today!

  7. #7
    Forum Contributor
    Join Date
    04-29-2012
    Location
    nuneaton, England
    MS-Off Ver
    Office 365
    Posts
    370

    Re: hlookup or index/match

    as the data increases patients will/may come back for more treatment so another entry for that patient will be seen, so the next date and list of tray id's will be needed. but i dont want it to show up if its the same date, will look at the file now

  8. #8
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: hlookup or index/match

    If it does end up getting much more complicated as you seem to suggest it may be worthwhile to look into a vba solution, otherwise the formulas will get very long.

  9. #9
    Forum Contributor
    Join Date
    04-29-2012
    Location
    nuneaton, England
    MS-Off Ver
    Office 365
    Posts
    370

    Re: hlookup or index/match

    ive looked at your sheet, can you ammend it so that it doesnt look at the same date in the previous column. i just want 1 date with the information below it, then the next column would be another date.

  10. #10
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: hlookup or index/match

    I cannot think of a good way outside of vba to accomplish that since there is multiple occurrences and there really is no pattern to them.

    You could just have a little manual portion to the process, or just ignore the populated columns you do not need if you do not want to mess with vba.

  11. #11
    Forum Contributor
    Join Date
    04-29-2012
    Location
    nuneaton, England
    MS-Off Ver
    Office 365
    Posts
    370

    Re: hlookup or index/match

    i dont mind messing with VBA if there is a solution, i have used VBA on other workbooks, but dont really know how to create it.

  12. #12
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: hlookup or index/match

    This attachment has the original solution up top native formula only, and the bottom is with a UDF (takes a little more processing time since for each occurrence that is not found (all dates that are blank) it will run through all data rows looking for another occurrence).
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    04-29-2012
    Location
    nuneaton, England
    MS-Off Ver
    Office 365
    Posts
    370

    Re: hlookup or index/match

    thank you hawkeye

  14. #14
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: hlookup or index/match

    No problem - just for reference,

    DateLookup(hospital number as a string, n as integer) will find the nth unique date for the given hospital number, and if there is not n unique dates for that number it will throw an error.

+ 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/hlookup?
    By Shadefalcon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-16-2013, 08:34 AM
  2. HLOOKUP using MATCH and INDEX
    By cocostar88 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-22-2013, 09:50 AM
  3. HLOOKUP and INDEX/MATCH?
    By 01FASTWS6 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-07-2012, 01:27 PM
  4. Index and Match or Hlookup
    By pauldaddyadams in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-10-2011, 04:37 AM
  5. Hlookup and Index match?
    By geng in forum Excel General
    Replies: 4
    Last Post: 12-05-2010, 11:21 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