+ Reply to Thread
Results 1 to 2 of 2

Issue with calendar month in formula - need a specific date range

  1. #1
    Registered User
    Join Date
    04-26-2019
    Location
    London
    MS-Off Ver
    2016
    Posts
    6

    Issue with calendar month in formula - need a specific date range

    Hello

    I'm using the attached finance manager template I found online to track all my income/expenditure. The report on the second sheet pulls through some analysis based on the transactions I enter on the first sheet. When I select a calendar month in H3, the report is currently configured to display the figures for all the transactions in that given month.

    However, if you refer to the transactions sheet, you'll see in column J that the month doesn't always correspond with the actual month for the transaction dates in column A (see rows 14-18). That's because I track my finances based on my pay period - which is 23rd to 22nd of the following month. So all transactions that occur between 23 August and 22 September will be marked as 'August' in column J on the transactions sheet; all transactions between 23 September and 22 October will be marked as 'September'; and so forth.

    I would like the report on the second sheet to reflect my pay period as oppose to calendar months. So for example, when I select August in H3 on the report, I would like the spreadsheet to pull through all figures marked as 'August' on the transactions sheet in column J (regardless of what date they actually occurred).

    I hope that makes sense and would appreciate any help with this.

    Thanks
    Attached Files Attached Files

  2. #2
    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: Issue with calendar month in formula - need a specific date range

    The date range which your Report sheet is searching is defined in all the formula by these:
    Start date: ">"&EOMONTH(I_CHOSEN_MONTH,-1)
    End date: "<="&I_CHOSEN_MONTH
    I_CHOSEN_MONTH is the date in H3, which in your sample sheet is 30 Sep 2020. The start/end dates above therefore translate as 'the end of the month before the chosen date' and 'the chosen date'.

    Hence what you need to do is amend those parts of the formulae to look at what you want to be the start and end dates.

    1. Select everything on the Report sheet.
    2. Go to 'Find and Replace' (keyboard shortcut Ctrl-H).
    3. In the 'Find' box, enter this:
    ">"&EOMONTH(I_CHOSEN_MONTH,-1)
    4. In the 'Replace' box, enter this:
    ">="&EOMONTH(I_CHOSEN_MONTH,-1)+23
    5. Click 'Replace All'.
    6. Open F&R again and enter this in the 'Find' box:
    "<="&I_CHOSEN_MONTH
    7. Enter this in the 'Replace' box:
    "<"&EOMONTH(I_CHOSEN_MONTH,0)+22
    8. Click 'Replace All'.

    Note that I've changed > to >= and changed <= to <. This is because you can then see the start/end dates of your pay periods directly in the formulae (23 and 22), which I think is easier to understand.

    That should do it. Hope that makes sense and does what you need.
    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. [SOLVED] Formula For Specific Days in a Date Range BY MONTH
    By AWhitehouse in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-20-2020, 09:04 PM
  2. [SOLVED] Formula to test if date is in the previous calendar month
    By kersplash in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-03-2017, 09:31 PM
  3. Populate a specific range based on calendar date
    By gottnoskill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2014, 03:19 PM
  4. [SOLVED] Formula to return End OF Month date with non-calendar month lengths.
    By Snoddas in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 05-09-2014, 08:45 AM
  5. display calendar for a given month or date range in a row without weekends
    By wunmi in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-07-2014, 05:22 PM
  6. Formula to Show Accounting Month based on a specific date range
    By michelle saluta in forum Excel General
    Replies: 1
    Last Post: 09-23-2010, 02:17 PM
  7. [SOLVED] is there a formula to generate a calendar month date rather than .
    By lmurray in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-21-2005, 12:06 PM

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