+ Reply to Thread
Results 1 to 12 of 12

Total Cells if within a Certain Date

  1. #1
    Registered User
    Join Date
    11-13-2014
    Location
    Windsor
    MS-Off Ver
    Office 365
    Posts
    11

    Total Cells if within a Certain Date

    Looking for some help!

    I have a list of Employee ID's and need to total the number of days in column D (per employee ID) if the dates provided are in July.

    Attached is the sample workbook - any help would be greatly appreciated!

    I realise that you will have to summarise the data in a pivot table but can't work out the calculations.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,409

    Re: Total Cells if within a Certain Date

    Which version of Excel are you using?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    11-13-2014
    Location
    Windsor
    MS-Off Ver
    Office 365
    Posts
    11

    Re: Total Cells if within a Certain Date

    Hi AliGW - i'm using office 365

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,409

    Re: Total Cells if within a Certain Date

    Thanks - please update your forum profile.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,409

    Re: Total Cells if within a Certain Date

    Here is a PowerQuery solution.

    M Code:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-13-2014
    Location
    Windsor
    MS-Off Ver
    Office 365
    Posts
    11

    Re: Total Cells if within a Certain Date

    Thanks AliGW - will update my profile - if I wanted to do this for August, September etc once the dates are populated is there an easy way to do this?

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,409

    Re: Total Cells if within a Certain Date

    Yes - you just change the month or months that are filtered in the query.

    Alternatively, leave the query unfiltered, then add a sub-totals line to the table and filter that.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,409

    Re: Total Cells if within a Certain Date

    Please update your profile, as requested.

    Attached is the alternative suggestion I made in my previous post.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-13-2014
    Location
    Windsor
    MS-Off Ver
    Office 365
    Posts
    11

    Re: Total Cells if within a Certain Date

    thanks AliGW - is there an easy way to add this to another file that I pull a report from?

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,409

    Re: Total Cells if within a Certain Date

    Yes. First, import the data from the other workbook using Get Data | From File | From Workbook. Now you can copy the code from the original query into the new one. This assumes that the data layout will be the same. The query isn't hard to learn - just step through the steps in the query editor to work out how it's done.

  11. #11
    Registered User
    Join Date
    11-13-2014
    Location
    Windsor
    MS-Off Ver
    Office 365
    Posts
    11

    Re: Total Cells if within a Certain Date

    not sure this solution will work for me as i will need to input this solution into my other workbook rather than this way round - do you know of any other way?

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,409

    Re: Total Cells if within a Certain Date

    Not a problem! In the other workbook, load the table to PQ in the same way and use the code I have given you - just tweak it as necessary.

+ 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] sum total of cells that contain a date - seems simple but cannot get this work!
    By TaylorGC in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-23-2020, 11:16 AM
  2. [SOLVED] Total blanks in a set of cells based on the date in a different column
    By heresteve2 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-23-2016, 11:20 AM
  3. Need to Calculate Total Hours from 2 date cells and 2 time cells in military time.
    By psunursingguy21 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-07-2015, 06:46 PM
  4. [SOLVED] Macro to Total a Column Up 15 cells and place total in cell of last row
    By guitarsweety in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-20-2014, 05:25 PM
  5. Replies: 24
    Last Post: 10-08-2014, 10:31 AM
  6. [SOLVED] How do I get total hours from 2 date/time cells?
    By Rick Taylor in forum Excel General
    Replies: 4
    Last Post: 06-06-2006, 02:45 PM
  7. Subtract a group of cells from a total based on ending date
    By Nicholas Scarpinato in forum Excel General
    Replies: 0
    Last Post: 05-17-2005, 11:06 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