+ Reply to Thread
Results 1 to 13 of 13

Complicated Excel Lookup Count

  1. #1
    Registered User
    Join Date
    01-09-2015
    Location
    london, england
    MS-Off Ver
    2011
    Posts
    10

    Complicated Excel Lookup Count

    Hello,

    (Note: I have now amended the post and file).

    Thanks in advance for your help and to all the contributors here.

    I’ve been trying for weeks to get the following to work but have finally given up the ghost and am asking (begging) for help.

    Here is the file: filev2.xlsx

    I have raw data sent to me in a fixed excel format every day (C1:F53) in the attached sheet although the number of rows can vary and number of towns can vary. Columns stays fixed at 4 (C:F). I need to figure out a way for excel to use a flexible table_array to lookup certain dates within that table and return a count into 2 tables (H1:J86) & (L1:N86).


    The raw data (C1:C53) in this example whilst always 4 columns in width, number of rows can vary depending on how many dates & towns are in the raw data on a given day.

    I have tried to do a lookup but I cannot get the table_array to change dynamically according to how many rows the raw data has for that particular town.

    The lookup is also very difficult as there are gaps between the rows.

    So what I would like excel to do to populate Table 1 (H1:J86):

    a) lookup the code BFSI04 (for example) in cell I1 and match it to Belfast in the mapping table (A4:B34).

    b) Then go to the raw data table (C1:C53) and do a count of the "Out Date:" for Belfast and return the count into Table 1 next to the relevant date. The count for each date is in the fourth column in the raw data, "Out Count". So for example the first date in the Belfast raw data is 16/01/2015. The count in "Out count" is 1. So it returns 1. I have populated the table (H1:J86) as I would like it to be after all calculations are done. I have highlighted the cells red for the "Out Dates" as they appear in column C, but also appear in Column D as the first date of pairs.

    So what I would like excel to do to populate Table 2 (L1:N86):

    a) As above, lookup the code BFSI04 (for example) in cell M1 and match it to Belfast in the mapping table (A4:B34).

    b) however this time I need a sum of "In Dates:". The "In Date" in column D I have highlighted in yellow. It will always be below an "Out Date:", highlighted in red as that was when the product went out. In is when it came back. So for example for Belfast 2 products came back on the 26/01/15, so cell M19 in Table 2 has 2. Unfortunately whilst Column F is populated by the report with the count for "Out Date:" the raw data report does not populate a count for the "In Date:" although the "In date" (red) is always going to be below the "Out Date" (yellow) if that helps.

    I apologise if this appears complicated. Even pointing me in the right direction would be a big help. Is something like this possible using formula or does it need to be VBA based as the lookup table_array needs to change its height everyday. I have tried everything but I am at a loss.


    Thank you so much!
    Last edited by deejaynv; 01-11-2015 at 11:37 AM.

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Complicated Excel Lookup Count

    Then go to the raw data table (C1:C53) and do a count of the "Out Date:" for Belfast and return the count into the first table above.
    When you say "return count into the first table above" I'm not clear about the "first table above" location. Can you specify?

  3. #3
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Complicated Excel Lookup Count

    Are the number of rows for each town always 24? Or is that what you meant by the number of rows can vary?
    Spread the love, add to the Rep

    "None of us are as smart as all of us."

  4. #4
    Registered User
    Join Date
    01-09-2015
    Location
    london, england
    MS-Off Ver
    2011
    Posts
    10

    Re: Complicated Excel Lookup Count

    Quote Originally Posted by FlameRetired View Post
    When you say "return count into the first table above" I'm not clear about the "first table above" location. Can you specify?
    Hello sir. Yes sorry I was unclear there. I meant to say "return count into table (H1:J86). I have already filled in the table manually but I would like it automated so it fills itself depending on the raw data in (C1:C53).

    Thanks again.

  5. #5
    Registered User
    Join Date
    01-09-2015
    Location
    london, england
    MS-Off Ver
    2011
    Posts
    10

    Re: Complicated Excel Lookup Count

    Quote Originally Posted by mcmahobt View Post
    Are the number of rows for each town always 24? Or is that what you meant by the number of rows can vary?
    Hello sir.

    The number of rows for each town can vary. In fact sometimes there may not be a town there it just depends on the day. In fact there are 12 towns in total I just included 2 for ease of explanation.

    Hope that makes sense and thank you very much for looking.

  6. #6
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Complicated Excel Lookup Count

    Is there a specific town that will always return last on the list? I was able to get column I working, working on column J now, but it is hard if not all the towns are listed.

    For reference, paste this into cell I2 and drag down:

    Please Login or Register  to view this content.
    Do these results at least look correct?

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: Complicated Excel Lookup Count

    Because of your raw data table is vary and not in uniform, I suggess a helper sheet to give a start. Then let's see what can be done next from the helper sheet.
    Attached Files Attached Files
    Quang PT

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Complicated Excel Lookup Count

    Quote Originally Posted by deejaynv View Post
    Hello sir.

    The number of rows for each town can vary. In fact sometimes there may not be a town there it just depends on the day. In fact there are 12 towns in total I just included 2 for ease of explanation.

    Hope that makes sense and thank you very much for looking.
    Just in case a lookup table can be used in solution can you include a complete list of those towns in your workbook?

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Complicated Excel Lookup Count

    explain more.

    how do you get the orginal data (F45 en F47 are not confirmed)

    The tabel H - J are also available (in the original sheet)?
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  10. #10
    Registered User
    Join Date
    01-09-2015
    Location
    london, england
    MS-Off Ver
    2011
    Posts
    10

    Re: Complicated Excel Lookup Count

    Quote Originally Posted by mcmahobt View Post
    Is there a specific town that will always return last on the list? I was able to get column I working, working on column J now, but it is hard if not all the towns are listed.

    For reference, paste this into cell I2 and drag down:

    Please Login or Register  to view this content.
    Do these results at least look correct?
    Really appreciate the quick response. Yes the results look correct.

    No there is not a specific town will always return last on the list simply because some towns may not always return on the list so it is tough to tell which will and which won't. But I am happy to go into the last cell at the bottom of the raw data and type in a piece of text if that helps so the lookup knows when to stop looking down?

    Everyone here helped so fast I wasn't expecting it so I left work I don;t have the full list of towns but I will pop into work tomorrow and get the full list.

    Thanks again really appreciate it.

  11. #11
    Registered User
    Join Date
    01-09-2015
    Location
    london, england
    MS-Off Ver
    2011
    Posts
    10

    Re: Complicated Excel Lookup Count

    thank you very very much. I am going to go through all of your sheet in depth properly later and try and understand it and then take it from there.

  12. #12
    Registered User
    Join Date
    01-09-2015
    Location
    london, england
    MS-Off Ver
    2011
    Posts
    10

    Re: Complicated Excel Lookup Count

    Everyone here helped so fast I wasn't expecting it so I left work I don't have the full list of towns but I will pop into work tomorrow and get the full list.

    Thank you again!

  13. #13
    Registered User
    Join Date
    01-09-2015
    Location
    london, england
    MS-Off Ver
    2011
    Posts
    10

    Re: Complicated Excel Lookup Count

    Quote Originally Posted by FlameRetired View Post
    Just...
    Quote Originally Posted by bebo021999 View Post
    Because...
    Quote Originally Posted by mcmahobt View Post
    Are...
    Quote Originally Posted by oeldere View Post
    explain...
    Thank you all for your help I popped into work and have now updated the file in the first post to include the full list of towns and also given a full explanation of what I need to Excel to do to give me the count for "Date In" as well as "Date Out".

    I think you guys have helped me more than I could have expected with the "Date Out:" counts and it's pretty much there but the "Date In:" count is very complicated for me to understand as it is always paired up with the "Date Out:" as I have detailed in the first post on this thread.

    Again any help really appreciated.

    Thanks so much!
    Last edited by deejaynv; 01-11-2015 at 11:47 AM.

+ 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. Complicated Excel Lookup Count - Any help appreciated
    By deejaynv in forum Excel General
    Replies: 4
    Last Post: 01-09-2015, 03:03 PM
  2. [SOLVED] Complicated lookup
    By tlapointe1970 in forum Excel General
    Replies: 4
    Last Post: 02-20-2014, 06:42 PM
  3. Complicated V Lookup help
    By christianbber in forum Excel General
    Replies: 5
    Last Post: 05-31-2012, 09:59 AM
  4. Can I get excel to count a date range? but slightly more complicated
    By daybreak in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-07-2011, 04:30 PM
  5. Complicated value lookup
    By TheFarmer42 in forum Excel General
    Replies: 10
    Last Post: 05-10-2006, 12:10 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