+ Reply to Thread
Results 1 to 5 of 5

Date being replaced by text in monthly financial period but still acting as a date

Hybrid View

  1. #1
    Registered User
    Join Date
    11-22-2024
    Location
    Ottawa, Canada
    MS-Off Ver
    MS365
    Posts
    14

    Date being replaced by text in monthly financial period but still acting as a date

    Hello,

    Quick question, hopefully this doesn't require VBA.

    In my spreadsheet attached, look at cell K5 (highlighted in yellow)
    Instead of entering the month, I'd like to be able to enter P1, P2 or whatever period up to P12 instead of the date BUT the calculations would still happen as if it was a date in K5. (even better if I can put it in a dropdown list)

    Mar-2024 represents P1
    Apr-2024 represents P2
    May-2024 represents P3 and so on
    .
    .
    Feb-2025 represents P12

    Thank you for your help.
    Pat
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,042

    Re: Date being replaced by text in monthly financial period but still acting as a date

    The way to do this with the least impact is to put your selection in a different cell, then use K5 to translate the selection to date. Then none of your other formulas would have to change. See attached.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    11-22-2024
    Location
    Ottawa, Canada
    MS-Off Ver
    MS365
    Posts
    14

    Re: Date being replaced by text in monthly financial period but still acting as a date

    Thank you very much. I'd like to better understand what you did. It works perfectly. Can you please explain what you did?

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,042

    Re: Date being replaced by text in monthly financial period but still acting as a date

    In K4 I entered a dropdown list with P1,P2,P3...P12. You mentioned using a dropdown list, so I assume you know how those work but I can give more detail if you need it.

    Then in K5 I replace the date with this formula:

    Formula: copy to clipboard
    =EDATE(DATE(2024,3,1),VALUE(MID($K$4,2,2))-1)


    MID looks at the value in K4 starting with the second character. This has the effect of removing the "P" at the beginning. Then VALUE changes it from a string to a number. That represents the month number. The DATE gives the start of the first month, March 1, 2024. EDATE adds months to that. So we take the number after P, subtract 1, and add that many months to the starting month. This gives you the date in K5.

    Since you had a date in K5 before, no other formulas needed to change, just the method for getting the date.

  5. #5
    Registered User
    Join Date
    11-22-2024
    Location
    Ottawa, Canada
    MS-Off Ver
    MS365
    Posts
    14

    Re: Date being replaced by text in monthly financial period but still acting as a date

    Thank you very much for the explanation. Helps me get better. Cheers!

+ 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. Date cell not acting right
    By Sliver5489 in forum Excel General
    Replies: 4
    Last Post: 01-25-2024, 05:24 AM
  2. [SOLVED] Convert Date to Financial period and year
    By Philangr8 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-29-2015, 02:06 PM
  3. Replies: 4
    Last Post: 06-12-2014, 11:37 AM
  4. [SOLVED] Semi Monthly autofill Period Starting Date based on Period Ending Date
    By greatwent in forum Excel General
    Replies: 6
    Last Post: 01-30-2014, 03:29 AM
  5. Replies: 0
    Last Post: 07-25-2013, 10:03 AM
  6. Replies: 2
    Last Post: 06-07-2013, 02:21 PM
  7. Replies: 1
    Last Post: 12-13-2010, 08:07 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