+ Reply to Thread
Results 1 to 16 of 16

Create rule using date-range to generate cell header

  1. #1
    Registered User
    Join Date
    07-06-2017
    Location
    California
    MS-Off Ver
    unsure
    Posts
    13

    Create rule using date-range to generate cell header

    Hi,

    Is there a way to create a rule using a date-range to result in a cell being labeled something in particular?

    For example, if TODAY() is between 4/1/2017 and 6/30/2017, the cell will say "Quarter 4",
    whereas if today's date is between 7/1/2017 and 9/30/2017, that cell will instead say "Quarter 1".

    Thank you.

  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: Create rule using date-range to generate cell header

    Try this in A1 and fill across. It returns quarters based on fiscal year 7/1 to 6/30.

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


    Does this do what you want?


    A
    B
    C
    D
    1
    Quarter 3
    Quarter 4
    Quarter 1
    Quarter 2
    2
    2/5/2017
    4/15/2017
    8/12/2017
    12/1/2017
    Dave

  3. #3
    Registered User
    Join Date
    07-06-2017
    Location
    California
    MS-Off Ver
    unsure
    Posts
    13

    Re: Create rule using date-range to generate cell header

    Yes,
    except I wouldn't even want to see the dates shown in row 2.

    Instead, I would have statistics pertaining to the quarter, below the "quarter" heading.

    I suppose I could just hide that row of dates if they are absolutely necessary,
    or just have one cell off to a corner somewhere that contains today's date (for use in the formula).

    Here's the tricky part though (which is why, on my original post, I mentioned/inquired into the possibility of using date-range(s)):
    I don't want the Quarter number to populate based off of the actual working standardized and accepted fiscal year.

    I mean, I want to open my Excel sheet to work on it, say, tomorrow (the 7th of July [which is now Quarter 1 fiscally]),
    but I'm going to be working on a report to report on statistics for the previous quarter, thus, even though it's July 7th I'd want the report to reflect/say Quarter 4.

    Seems like a lot of work (doesn't it?) when I could manually just type in the words "Quarter 4" (or whatever quarter I want),
    but on a large spreadsheet with lots of "Quarter __" listed, and on a workbook that I'll be updating 'frequently' (every few months or so),
    I wouldn't want to manually change them month after month if I could simply have the Quarter headers auto-populate.

    Thanks Dave (and anyone else who responds).

    Quote Originally Posted by FlameRetired View Post
    Try this in A1 and fill across. It returns quarters based on fiscal year 7/1 to 6/30.

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


    Does this do what you want?


    A
    B
    C
    D
    1
    Quarter 3
    Quarter 4
    Quarter 1
    Quarter 2
    2
    2/5/2017
    4/15/2017
    8/12/2017
    12/1/2017
    Last edited by Pancho1990; 07-07-2017 at 12:29 AM.

  4. #4
    Registered User
    Join Date
    07-06-2017
    Location
    California
    MS-Off Ver
    unsure
    Posts
    13

    Re: Create rule using date-range to generate cell header

    Something like:

    IF TODAY() is between July 1 2017 and September 30 2017, the cell should say Quarter 4.

    **according to the fiscal year, July 1 through Sep 30 is Quarter 1, but the worksheet I'm working on is reporting on the previous quarter, which is why I want it to say Quarter 4, and which is why I probably can't use that formula you gave me Dave.

  5. #5
    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: Create rule using date-range to generate cell header

    Instead, I would have statistics pertaining to the quarter, below the "quarter" heading.
    OK.

    Is there anything in those statistics that is unique to it's relevant month?

  6. #6
    Registered User
    Join Date
    07-06-2017
    Location
    California
    MS-Off Ver
    unsure
    Posts
    13

    Re: Create rule using date-range to generate cell header

    Believe me, if it was only one time that I had to write "Quarter ___", I'd just type it in,
    but since there are almost a dozen mentions of different Quarters,
    and since this will be a recurring report in months to come,
    I thought I'd explore the possibility of creating that rule.

    Thanks for reading and responding.

  7. #7
    Registered User
    Join Date
    07-06-2017
    Location
    California
    MS-Off Ver
    unsure
    Posts
    13

    Re: Create rule using date-range to generate cell header

    Yes.

    Does this help or hurt the 'simplicity' of what I'm (we're) trying to do here?

    Quote Originally Posted by FlameRetired View Post
    OK.

    Is there anything in those statistics that is unique to it's relevant month?

  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: Create rule using date-range to generate cell header

    OK.

    Now I'm really confused.

    If I now understand correctly Excel would have to read our minds. The instructions started out with 7/1 is quarter 1. Now 7/1 is understood to be referencing the previous quarter ... and that is only for the current session?

    What am I missing?

  9. #9
    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: Create rule using date-range to generate cell header

    Our posts are "crossing" in the ether.

    What page are we on?

  10. #10
    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: Create rule using date-range to generate cell header

    Quote Originally Posted by Pancho1990 View Post
    Yes.

    Does this help or hurt the 'simplicity' of what I'm (we're) trying to do here?
    I don't know enough to comment.

    Could you share what the unique "tells" in the statistics are for the relevant months?

  11. #11
    Registered User
    Join Date
    07-06-2017
    Location
    California
    MS-Off Ver
    unsure
    Posts
    13

    Re: Create rule using date-range to generate cell header

    You're right, Flame, in catching my inconsistency:
    I should've been clear right off the bat:

    I DO want 7/1 to reference the previous quarter.
    This rule would hold true for all date ranges (that is, always referencing the previous quarter, or, in fact, the date resulting in any title/label that I choose [because I plan on going into Quarters 5, 6, 7, 8 in months to come [which, as you know, are not in the typical 4-quarter system]).

    Thanks for your patience.

    Quote Originally Posted by FlameRetired View Post
    OK.

    Now I'm really confused.

    If I now understand correctly Excel would have to read our minds. The instructions started out with 7/1 is quarter 1. Now 7/1 is understood to be referencing the previous quarter ... and that is only for the current session?

    What am I missing?

  12. #12
    Registered User
    Join Date
    07-06-2017
    Location
    California
    MS-Off Ver
    unsure
    Posts
    13

    Re: Create rule using date-range to generate cell header

    Specifically, as an example:
    if TODAY() is July 1, 2017 - Sep 30, 2017, cell label should read Quarter 4,
    if TODAY() is Oct 1, 2017 - Dec 31, 2017, cell label should read Quarter 5,
    etc.
    until I reach Quarter 8.

    Is that possible in Excel?

    *Let's say we want to forget about Quarter conventions and just have any label title result from a date.
    Say I want the cell to read Trailer if within whatever date range.
    Last edited by Pancho1990; 07-07-2017 at 01:05 AM.

  13. #13
    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: Create rule using date-range to generate cell header

    The rules keep changing. I can't keep up.

    Would you post an Excel workbook (not a pic or screenshot please ... it saves having to retype the data)?

    Show a BEFORE section of what you are working with and an AFTER section (hand typed in) showing expected results. Explain the logic ... how you got from the BEFORE to the AFTER.

    If you are not familiar with how to attach a file:

    To attach a file to your post,
    • be sure to desensitize the data
    • click “Go Advanced” (next to Post Quick Reply – bottom right),
    • scroll down until you see “Manage Attachments”, click that,
    • click “Browse”.
    • select your file(s)
    • click “Upload”
    • click “Close window”
    • click “Submit Reply”

    The file name will appear at the bottom of your reply.

  14. #14
    Registered User
    Join Date
    07-06-2017
    Location
    California
    MS-Off Ver
    unsure
    Posts
    13

    Re: Create rule using date-range to generate cell header

    Attached is your request. Thank you.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    12-17-2016
    Location
    South Wales
    MS-Off Ver
    Excel 2007, 2016
    Posts
    68

    Re: Create rule using date-range to generate cell header

    Does this do what you want?

    =ROUNDUP(MONTH(TODAY())/3,0)+(YEAR(TODAY())-2017)+1

    The ROUNDUP bit calculates a quarter number based on the year starting from January. The YEAR bit means that the quarter numbers continue to rise in subsequent years (2017 is the base year). And +1 is an adjustment to reflect the fact that your year doesn't start in January.

  16. #16
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Create rule using date-range to generate cell header

    Okay, getting the quarters to be numbered 1-8 then restart was a bit tricky. Getting the 'next quarter' number to do the same was even trickier and I'm sure there's a more elegant way of doing this.

    Where you want 'Quarter 4' to appear in the 'After' section of your file, use this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Where you want 'Quarter 5', use this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I'll have another look at the second formula when I've not been awake for nearly 24hrs. In the meantime, please let me know if those do what you need.

    Attached is your file, showing those formulae working for dates into the next couple of years - the dates in B16 to B29.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

+ 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 generate random number with rule?
    By Mihelherbiii in forum Excel General
    Replies: 13
    Last Post: 04-10-2016, 12:45 PM
  2. How do I use a date typed in a cell to create a range for another formula?
    By Hstclair05 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-01-2016, 05:48 PM
  3. Replies: 6
    Last Post: 10-20-2015, 12:51 AM
  4. Create a row that is a group header for grouped rows by date
    By mramey64 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-09-2013, 11:48 AM
  5. How to create a rule depending on date periods?
    By visakov in forum Excel General
    Replies: 10
    Last Post: 03-22-2012, 02:21 PM
  6. VBA change cell rule from list to range
    By momo156 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2011, 12:38 PM
  7. If Cell is Empty create rule to Display the current Date
    By Sidewinder in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-05-2007, 04:12 PM

Tags for this Thread

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