+ Reply to Thread
Results 1 to 32 of 32

a very difficult HLOOKUP?

  1. #1
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    a very difficult HLOOKUP?

    Now for a very difficult.
    in excel 2007 i have an array of data A4 to E91
    so we have five numbers is each raw. lets say in A4: 10 B4: 14 C4: 9 D4: 21 E4: 40

    i want to know this sequence of numbers (10,14,9,21,40) if they appear and if yes how many appearances in the array of data A4:91
    Attached Files Attached Files

  2. #2
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: a very difficult HLOOKUP?

    hI, Try,
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Same approach for remaning numbers also
    Click just below left if it helps, Boo?ath?

  3. #3
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    Re: a very difficult HLOOKUP?

    i dont want only one numbers appearance i want the hole sequence of 10,14,9,21,40 if they ever appear in the same raw !

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: a very difficult HLOOKUP?

    so if I understand you, you want to find out if you have 10, 14, 9, 24, 40 in any other row but in any order so if it appears again but in this order 24, 9, 40, 14, 10 then you want to count that, correct?
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    Re: a very difficult HLOOKUP?

    exactly i don't care about the order of the numbers.

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: a very difficult HLOOKUP?

    well based on the data you posted, i don't see a single instance of a repeating set of values though i had to do it by hand, it wasn't very difficult but it took me a couple steps to do it. But the way I did it, keeping your data set together in columns A through E, in col F i did a sum of A4:E4 copied down. Then took those values and copied them elsewhere as values, then removed duplicates, then sorted cols A:F on F ascending, then did a count of the summed values and any values where there were more than 1 I checked to see if the two rows matched in any order. But if you have a large dataset this could be time consuming.

  7. #7
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    Re: a very difficult HLOOKUP?

    i have a dataset A4:E1767

  8. #8
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    Re: a very difficult HLOOKUP?

    send me your excel to take a look , but i dont want the sum values, i want the exact series numbers if they appear in any raw but i dont care about the order.

  9. #9
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: a very difficult HLOOKUP?

    Here is your table back with my brief explanations of how i would approach it.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    Re: a very difficult HLOOKUP?

    Quote Originally Posted by Sambo kid View Post
    Here is your table back with my brief explanations of how i would approach it.
    the problem is that i dont care about the sum of the rows numbers, i don't want that.
    i want the series of numbers in the same row if and how many times appear in the datasheet.

  11. #11
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: a very difficult HLOOKUP?

    well the assumption I made is that if the numbers are the same in any row but in a different order, then the sum of those numbers will have to be the same. That is why I summed them.

  12. #12
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    Re: a very difficult HLOOKUP?

    thanks for your effort but i am looking for something else.

  13. #13
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: a very difficult HLOOKUP?

    Hey, I understand, you have a lot of rows to look through doing that by hand. Good luck and I'll watch to see what someone else offers.

  14. #14
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    Re: a very difficult HLOOKUP?

    i have almost 2000 rows but only 5 columns

  15. #15
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: a very difficult HLOOKUP?

    Hi.

    What's the "Top Five Numbers" bit for?

    Which numbers are you searching for? Where are they in this workbook?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  16. #16
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    Re: a very difficult HLOOKUP?

    Quote Originally Posted by XOR LX View Post
    Hi.

    What's the "Top Five Numbers" bit for?

    Which numbers are you searching for? Where are they in this workbook?

    Regards
    Ignore the top five numbers.
    so we have five numbers is each raw. lets say in A4: 10 B4: 14 C4: 9 D4: 21 E4: 40

    i want to know this sequence of numbers (10,14,9,21,40 ALSO IN RANDOM ORDER) if they appear IN A RAW and if yes how many appearances in the array of data A4:1800

  17. #17
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: a very difficult HLOOKUP?

    Quote Originally Posted by stavroseco View Post
    I want to know this sequence of numbers (10,14,9,21,40) if they appear and if yes how many appearances in the array of data A4:91

    In cells J2:N2 I have listed the 5 numbers you want to match.

    In cell F2 I have put this formula which will only show a 1 if all 5 numbers match:
    =--(SUMPRODUCT(--(ISNUMBER(MATCH(A4:E4, $J$2:$N$2, 0)))) = 5)

    I've copied that formula down the data set.

    In N2 is this formula to give the count of matches:
    =SUM(F:F)
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  18. #18
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: a very difficult HLOOKUP?

    Jerry's has to be the most practical (and efficient) solution, though if for whatever reason you want the count using a single formula:

    =SUM(N(MMULT(N(COUNTIF(OFFSET(A5:E5,ROW(A5:E100)-MIN(ROW(A5:E100)),,,),A4:E4)=COUNTIF(A4:E4,A4:E4)),{1;1;1;1;1})=5))

    Change the upper range reference (100 here) as required.

    Regards

  19. #19
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: a very difficult HLOOKUP?

    Hi Stavros,

    Here's a VBA for only your stated goal:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  20. #20
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    Re: a very difficult HLOOKUP?

    i am not familiar with VBA can u explain the procedure ?

  21. #21
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    Re: a very difficult HLOOKUP?

    Quote Originally Posted by XOR LX View Post
    Jerry's has to be the most practical (and efficient) solution, though if for whatever reason you want the count using a single formula:

    =SUM(N(MMULT(N(COUNTIF(OFFSET(A5:E5,ROW(A5:E100)-MIN(ROW(A5:E100)),,,),A4:E4)=COUNTIF(A4:E4,A4:E4)),{1;1;1;1;1})=5))

    Change the upper range reference (100 here) as required.

    Regards
    thanks ! very nice !!!!

  22. #22
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    Re: a very difficult HLOOKUP?

    Quote Originally Posted by JBeaucaire View Post
    In cells J2:N2 I have listed the 5 numbers you want to match.

    In cell F2 I have put this formula which will only show a 1 if all 5 numbers match:
    =--(SUMPRODUCT(--(ISNUMBER(MATCH(A4:E4, $J$2:$N$2, 0)))) = 5)

    I've copied that formula down the data set.

    In N2 is this formula to give the count of matches:
    =SUM(F:F)
    Perfect!!!!

  23. #23
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: a very difficult HLOOKUP?

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  24. #24
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    Re: a very difficult HLOOKUP?

    nope i will wait a little more for a help in the vba from xladept

  25. #25
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: a very difficult HLOOKUP?

    Hi Stavros,

    Here are instructions for running a macro (VBA):

    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Open your Workbook

    Press ALT + F11 to open the Visual Basic Editor.

    Select "Module" from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name


    *But this routine only works on the one that you described in your first post - I'm thinking of a program that will deliver what you seem to actually want - shall I pursue it??

  26. #26
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: a very difficult HLOOKUP?

    Hi Stavros,

    I think that this is what you meant:

    Please Login or Register  to view this content.

  27. #27
    Registered User
    Join Date
    11-09-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: a very difficult HLOOKUP?

    If the sum of each row does not equal 94 then your sought numbers cannot possibly be in that row, so sum each row and filter by those that equal 94 for a start.

  28. #28
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    Re: a very difficult HLOOKUP?

    Quote Originally Posted by avendi View Post
    If the sum of each row does not equal 94 then your sought numbers cannot possibly be in that row, so sum each row and filter by those that equal 94 for a start.
    you lost me.

  29. #29
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: a very difficult HLOOKUP?

    I think what avendi is telling you is the same thing I told you in post #6 (i think). If the values are, say 10, 42, 9, 16, 12, they would add up to 89. If in another row you have 9, 42, 10, 12 and 16, they also add up to the same 89. You can't have the same values (same or different order) in two different rows that will NOT add up to the same total value. (just my guess since I dropped off the thread a while ago.)

  30. #30
    Registered User
    Join Date
    11-05-2014
    Location
    GREECE
    MS-Off Ver
    2007
    Posts
    23

    Re: a very difficult HLOOKUP?

    ok, now i understand but as i said before i dont wont the added value of the row.
    i think my problem is solved with posts from XOR LX and JBeaucaire but i am waiting from some instructions from xladept.

  31. #31
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: a very difficult HLOOKUP?

    The reasons I forwarded that as part of the solution are:
    1) I thought your count of rows was managable
    2) it would be a way by hand to find rows that had the same OVERALL value and see if they had the same #s but different order.
    It was extraneous to your needs but part of my solution.

    So if your problem is solved don't forget to mark the post as solved and certainly add to the reputations of those who helped you. It is cheap, dosen't cost anything. and makes people happier that they spent time and effort trying to assist you.

  32. #32
    Registered User
    Join Date
    11-09-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: a very difficult HLOOKUP?

    That was my thought process, indeed

+ 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: 2
    Last Post: 12-20-2013, 12:12 AM
  2. HLOOKUP Help. HLOOKUP links to Drop down list problems
    By finalmike in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-02-2013, 07:08 PM
  3. HLOOKUP in HLOOKUP, Base Estimate Table in Excel
    By gqdallas in forum Excel General
    Replies: 20
    Last Post: 10-19-2009, 01:41 PM
  4. Difficult HLOOKUP/VLOOKUP
    By edwardpestian in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-05-2006, 03: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