+ Reply to Thread
Results 1 to 6 of 6

Year to Date calculation formula

  1. #1
    Registered User
    Join Date
    03-16-2015
    Location
    Saudi Arabia
    MS-Off Ver
    2010
    Posts
    26

    Year to Date calculation formula

    Hi

    I need help.

    In the attached document, I want the cell B5 to show the sum of the months from January until the date (the cell value in B4).


    So for example, If in cell B4 I select June, so cell B5 should so sum from January until June (i.e. From B8 until G8).

    Please help.

    Thanks,
    Assad
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Year to Date calculation formula

    Try this in B5:

    =SUM(B8:INDEX(B8:M8,MATCH(B4,B7:M7,0)))

  3. #3
    Registered User
    Join Date
    03-16-2015
    Location
    Saudi Arabia
    MS-Off Ver
    2010
    Posts
    26

    Re: Year to Date calculation formula

    I pasted this in the excel sheet but it is using empty cells in the excel sheet. Can you please provide the formulas for the attached sheet?

    I would be very grateful.

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Year to Date calculation formula

    63falcondude's formula works fine for me

    in B5
    =SUMPRODUCT((TEXT("01/"&B7:M7,"mm")<=TEXT("01/"&B4,"mm"))*(B8:M8))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Year to Date calculation formula

    I did...

    In your sample from post #1, you have the "select month" in B4, the numbers in B8:M8, and the corresponding month names in B7:M7.

  6. #6
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Year to Date calculation formula

    See attached.

    This is much more simple if instead of text for months you use date values and format them to read as month. I did this for your headers in row 7 using the formula (making each header technically current year (2018), months 1-12 and each the first day of the month (1)):

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


    and then made B4 a drop down validation list using those headers. I formatted B4 and row 7 using custom format of 'mmmm' to display them as full month name.

    Then your formula is simply in B5:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Since the start of the range you want the total from is always Jan, this gets the total for everything from the month in B4 (and less than or equal to it) back to January inclusive.
    Attached Files Attached Files
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

+ 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. Sum different months each month (Year to date calculation)
    By Musabi1978 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-26-2018, 09:15 PM
  2. Replies: 5
    Last Post: 04-11-2017, 09:23 AM
  3. [SOLVED] Calculation based on the day of the year, not the date, for projecting results
    By DianeP in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-22-2015, 08:56 AM
  4. Dynamic Year to Date Calculation
    By pbexcel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2014, 05:07 AM
  5. Calculation in year between two date problem
    By AVG123 in forum Excel General
    Replies: 2
    Last Post: 06-18-2014, 02:40 AM
  6. [SOLVED] Need Calculation - If A1=Annual, Anniv. Date for Current Year, else Biennial Date
    By TaxAnnihilator in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-11-2013, 06:06 PM
  7. Replies: 3
    Last Post: 08-14-2012, 05:14 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