+ Reply to Thread
Results 1 to 9 of 9

Determine the count over date range via Pivot/Macro

  1. #1
    Registered User
    Join Date
    08-04-2023
    Location
    Dubai, UAE
    MS-Off Ver
    Microsoft 365 (Version 2208 Build 16.0.15601.20644) 64-bit
    Posts
    5

    Red face Determine the count over date range via Pivot/Macro

    Dear Folks,

    Excited to be here and learn from the Excel Guru's.

    There is a specific task where I have been spending time over formulas and need your inputs if this can be done over pivot.

    I have 100x Devices (Badge No or Serial No) which provide a certain performance reading daily. I need to know exactly which devices have been giving consistent reading in last 30 days, 29 days, 28 days and so on to identify each device accordingly.

    Any support / direction is highly appreciated.
    Attached Files Attached Files
    Last edited by daryldsouza83; 08-04-2023 at 04:37 PM. Reason: Title could be misleading

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Determine the count over date range via Pivot/Macro

    I'm not sure if this is what you want.

    I notice that the range is 31 days and that they go from the current date on down.

    Enter in the number of days on cell AM2.

    The magic formula in column AJ is =COUNTA(OFFSET(E3,0,0,1,$AM$2))

    The offset command means, Start in E3 and go down zero rows and right zero columns and give me a range 1 row deep and whatever the value in cell AM2 is columns wide.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    08-04-2023
    Location
    Dubai, UAE
    MS-Off Ver
    Microsoft 365 (Version 2208 Build 16.0.15601.20644) 64-bit
    Posts
    5

    Re: Determine the count over date range via Pivot/Macro

    Hey thanks dflak for your response.

    It is 30 days, may be an error on me when creating this sample.

    Thanks for formula, isn't exactly what I was looking for though I'll try to work with it for now.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Determine the count over date range via Pivot/Macro

    Or this, not using Volatile OFFSET.
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    What does this mean
    . . . isn't exactly what I was looking for though I'll try to work with it for now.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Registered User
    Join Date
    08-04-2023
    Location
    Dubai, UAE
    MS-Off Ver
    Microsoft 365 (Version 2208 Build 16.0.15601.20644) 64-bit
    Posts
    5

    Re: Determine the count over date range via Pivot/Macro

    Hi TMS,

    My apologies, I guess i am unable to explain here the actual request.
    May be the below pic will help explain, What I am looking to do is find out over the last X days, which devices have been consistent.

    Example - 24 Devices were provided data consistently over 31 days, and if I could view that list of meters from a click over Pivot table.

    Capture.PNG
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Determine the count over date range via Pivot/Macro

    It seems to me that the meter in row 4 read consistantly for the last 21 days, 14-Jul through 4-Aug.
    Based on that I added a column populate using: =IFERROR(E$2-INDEX(E$2:AI$2,AGGREGATE(15,6,(COLUMN(E3:AI3)-COLUMN(D3))/(E3:AI3=""),1)),31)
    A pivot table is produced from the added column placing the count field in both the Rows and Values areas.
    A pivot chart is produced from the pivot table.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    08-04-2023
    Location
    Dubai, UAE
    MS-Off Ver
    Microsoft 365 (Version 2208 Build 16.0.15601.20644) 64-bit
    Posts
    5

    [SOLVED] Re: Determine the count over date range via Pivot/Macro

    Thanks a lot JeteMC !!

    This will definitely help me analyze over 600K devices.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Determine the count over date range via Pivot/Macro

    Thanks for the rep.

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Determine the count over date range via Pivot/Macro

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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] IF Formula To Determine Utilization Count Based On Date & Time Stamps
    By Gtrtim112 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-08-2020, 09:36 AM
  2. Replies: 4
    Last Post: 12-15-2014, 05:25 PM
  3. [SOLVED] how do I determine the maximum column count in a range ?
    By dschmitt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2014, 10:08 PM
  4. [SOLVED] Count range to determine score
    By aaron85w in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-02-2013, 12:17 AM
  5. [SOLVED] Determine if a certain date is within a range
    By miss_chloe in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2013, 09:49 AM
  6. Determine Selected Pivot Table Page Range Filters
    By ShredDude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-01-2010, 05:17 PM
  7. Determine/Use a date range
    By Michael Wise in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2005, 10:29 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