+ Reply to Thread
Results 1 to 15 of 15

Can't group by quarter (date)

  1. #1
    Forum Contributor
    Join Date
    10-05-2021
    Location
    Bronx, NY USA
    MS-Off Ver
    2021/365
    Posts
    126

    Can't group by quarter (date)

    What is it about the attached spreadsheet that won't let me group the paydate field by quarter?

    I know it must be simple that I'm overlooking.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Can't group by quarter (date)

    With Power Query

    Please Login or Register  to view this content.
    Excel 2016 (Windows) 64 bit
    B
    C
    D
    E
    F
    G
    H
    I
    18
    QTR Gross Total FWH Total SS Total Med Total SWH Total Other Total Net
    19
    3
    18333.32
    2746
    1136.68
    265.84
    942.36
    90.696606
    13151.74339
    20
    4
    27499.98
    4119
    1705.02
    398.76
    1413.54
    136.044909
    19727.61509
    Sheet: $110K
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    10-05-2021
    Location
    Bronx, NY USA
    MS-Off Ver
    2021/365
    Posts
    126

    Re: Can't group by quarter (date)

    Thanks for the response, but it shouldn't be that difficult.

    There should be no need to do power query or anything as advanced as that.

    One should be able to right-click on the date field and click group by, and select "Quarters".

    The real question here is why the other date options aren't showing up.

    And, why can't I group by this field, as I'm getting the error message "Can't group that selection".

    Attachment 836724

  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,953

    Re: Can't group by quarter (date)

    You could add a column to your source table to calculate the quarter and then group the PT on that.
    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.

  5. #5
    Forum Contributor
    Join Date
    10-05-2021
    Location
    Bronx, NY USA
    MS-Off Ver
    2021/365
    Posts
    126

    Re: Can't group by quarter (date)

    I'm thinking that the big question here is to why this is happening?

    In the two attached spreadsheets, the one called $750K contain the various scenarios and a group dating is working just fine, then this morning when I went into it to change the start date to August ' 23 in the $110K worksheet, everything went awry.

    Trying the solution suggested by AliGW kinda worked, but the quarter grouping looked a little weird.

  6. #6
    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,953

    Re: Can't group by quarter (date)

    The big question is "Why isn't it working the way I expect it to?" That is something you'll have to ask Microsoft.

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Can't group by quarter (date)

    Your issue here is that your dates in the source data is formatted/imported as Text. I have re-entered the data as Short Dates and created a new PT. I then grouped as Quarters
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    10-05-2021
    Location
    Bronx, NY USA
    MS-Off Ver
    2021/365
    Posts
    126

    Unhappy Re: Can't group by quarter (date)

    This continues to mind boggle me, for I have the field formatted as a date, or at least I made sure that it was formatted as a date after reading your post and seeing that field was formatted as "text", but even after formatting the field as a date, the pivot table still will not group by quarter.

    In other words, it's still not giving me the ability to group by other date intervals (date, month, year, quarter).

    And, I don't understand what has changed structurally?

    The only change that was made was a starter starting on July 15, 2023, the client decide to start payroll on August 15, 2023. So I change the start date of the data to arrange to August 15, 2023, and then everything went awry.

    This should've been a simple 1-2-3 process, change the date and refresh the pivot table, but judging by the way this is stomping the Group, and the solutions on YouTube, I guess it's not so simple
    Attached Files Attached Files

  9. #9
    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,953

    Re: Can't group by quarter (date)

    In the file you have attached, all you need to do is refresh the PT (Data ribbon > Refresh All).

    For future reference, just applying date formatting to a cell does not turn text into a date.

    If you select the date cells and change the formatting to GENERAL, you will still see the cells as dates instead of the 5-digit serial numbers you WOULD see if they really were dates. Real dates are numbers, not text.

    You can use Text to Columns on the Data ribbon to convert them:

    1. Select cells B4 to B13..
    2. Data ribbon | Text to Columns.
    3. Click Next > Next > choose MDY > Finish.

    Now the date values option will appear in the PT (you WILL have to refresh it first).
    Attached Files Attached Files
    Last edited by AliGW; 07-18-2023 at 12:56 AM. Reason: Workbook added.

  10. #10
    Forum Contributor
    Join Date
    10-05-2021
    Location
    Bronx, NY USA
    MS-Off Ver
    2021/365
    Posts
    126

    Post Re: Can't group by quarter (date)

    This is most troublesome, for I was able to recreate the entire spreadsheet faster.

    I'll try your solution of text to column conversion as stated in your previous post.

    This doesn't make any sense that it is easier to recreate as opposed to edit.

  11. #11
    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,953

    Re: Can't group by quarter (date)

    This doesn't make any sense that it is easier to recreate as opposed to edit.
    Explain what you mean by this.

    Looks like you have it working in your latest attachment.

    The issue is this: if you import data that contains dates, but those dates come into Excel as TEXT, then you have to convert them to real DATES before you can use them as dates. That's true for formulae, table filters and PTs.

    If dates are coming in as text, then it may be to do with the source data.

    How exactly are you importing data? Is it coming from a .csv file? If so, perhaps you can attach a sample .csv file that would show the issue.

  12. #12
    Forum Contributor
    Join Date
    10-05-2021
    Location
    Bronx, NY USA
    MS-Off Ver
    2021/365
    Posts
    126

    Re: Can't group by quarter (date)

    I'll try my best to explain below:

    The data is not imported from anywhere, it's a manual process based upon what the client tells us.

    It’s primarily designed for calculating the officer's salary payroll of small corporations getting paid on a semi-monthly basis.

    There are only 24 lines to the data set that we create by filling down the formulas once they are created.

    As the officer's salary is not changing, all we have to do is just set it once, and it's going to remain the same for the rest of the year, barring any significant changes.

    The FICA is set by the IRS, and then we go to an online payroll calculator, such as ADP's website and calculate the federal and state withholdings. Plug them in to the spreadsheet and copy them down.

    Now what we were doing was taking a previous file and editing it for the contents of the current scenario. And the problem that we were running into is when we changed the dates, such as in this case when payroll is starting in August 2023.

    As you can see the pivot table is on the same sheet as the data, and is in the first couple of rows as the data. So we couldn't just simply delete the first few rows to start at the row in which payroll is actually starting. In this case, we have to delete the first 14 or so rows.

    So what we were doing was copying the dates on which payroll was starting and pasting them on the first row. We copy the dates from August 15, 2023 - December 30, 2023 and paste it on the first row of January 15, 2023.

    Then deleting the excess rows, changing the data source for the pivot table, but that's when our date problems started: whereby we couldn't group by the date (as we wanted the data summarized by quarters).

    Maybe it is poor designing on our part to have the pivot table on the same sheet as the data, I don't know.

  13. #13
    Forum Contributor
    Join Date
    10-05-2021
    Location
    Bronx, NY USA
    MS-Off Ver
    2021/365
    Posts
    126

    Re: Can't group by quarter (date)

    Long story short, AliGW, your solution of the text to data conversion and choosing the date format worked perfectly: short sweet & simple.

    And I thank you a thousandfold for your patience and explanation

  14. #14
    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,953

    Re: Can't group by quarter (date)

    that we create by filling down the formulas once they are created.
    What formulae?

    How are these dates being entered? If they were being entered manually, they would not be appearing as text.

    So what we were doing was copying the dates on which payroll was starting and pasting them on the first row
    Coying and pasting from where? This might be where the issue is.

    Please directly answer the three questions in this post.

  15. #15
    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,953

    Re: Can't group by quarter (date)

    Long story short, AliGW, ...
    Glad to have helped.

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

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

+ 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. How to group chart values by quarter?
    By rizwanulhasan in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-04-2023, 05:53 PM
  2. [SOLVED] Group by Year and Quarter from Dynamic Array Date
    By dluhut in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-27-2022, 03:35 AM
  3. [SOLVED] Calculate Quarter (date) and Calculate Average of Quarter and Sum of Quarter
    By Bobbbo in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 02-26-2020, 06:16 PM
  4. [SOLVED] Converting 1 to January so you can then GROUP by quarter in PIVOT
    By BigErnKingpin in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 08-05-2019, 04:09 AM
  5. [SOLVED] Formula for converting a date to quarter and leaving blank cell for no date values
    By jayc2111 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-10-2019, 12:57 AM
  6. [SOLVED] Using SumProduct for dates inclusive of Year to Date, Month to date, Quarter to Date
    By cartica in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-26-2014, 04:22 PM
  7. Replies: 2
    Last Post: 01-04-2012, 09:15 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