+ Reply to Thread
Results 1 to 14 of 14

formula for year to date position help!

  1. #1
    Forum Contributor
    Join Date
    03-16-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    135

    Unhappy formula for year to date position help!

    Hi All

    I have data in excel which I need a formaula which calculates the year to date position when a month number is changed. for example

    Month
    Jan Feb March April..... Dec
    5 4 2 3 4

    In a input box in excel cell (E4)
    if 1 is entered into the box it would return 4 (jan)
    if 2 is entered into the box it would return 9 (jan + feb)
    ...
    if 4 is entered into the box it woulld return 14 (jan + feb+mar+april)

    Thanks

    Hope you can help

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2006
    Location
    Melbourne, Australia
    MS-Off Ver
    Office 2016
    Posts
    1,075

    Re: formula for year to date position help!

    Please attach a sample of your workbook so we can use your own data to find possible solutions. Remember to remove or replace and sensitive data before uploading.
    Trish in Oz
    -------------
    A problem well defined is a puzzle half solved


    If you attach a sample of your workbook it will be easier to find a solution. Remember to remove/replace sensitive data before uploading the file. Look here if you need help with attachments:
    http://www.excelforum.com/faq.php?fa...b3_attachments

  3. #3
    Forum Contributor
    Join Date
    09-18-2014
    Location
    Pakistan
    MS-Off Ver
    2013, 2016
    Posts
    283

    Re: formula for year to date position help!

    Need a sample file

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: formula for year to date position help!

    Assuming your data looks something like this...
    A
    B
    C
    D
    E
    1
    Jan Feb Mar Apr May
    2
    5
    4
    2
    3
    4
    3
    4
    4
    5
    14

    E5=SUM(OFFSET($A$2,0,0,1,$E$4))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Contributor
    Join Date
    03-16-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    135

    Re: formula for year to date position help!

    Hi

    Thank you all for your respond, I have attached a spreadsheet please can you let me know if this is possible.

    I just want the 'Call" to be summed up when a month is inputed into the yellow box in the spreadsheet.

    Thanks
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    03-16-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    135

    Re: formula for year to date position help!

    Hi

    Can anyone help

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: formula for year to date position help!

    Your attached file is not clear, give your expected result and some guide lines
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  8. #8
    Forum Contributor
    Join Date
    03-16-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    135

    Re: formula for year to date position help!

    HI nflsales

    I have provided more detail in the spreadsheet. Periods are like months, however I just want a formula where if 1 to 13 is inputed it should sum all the values year to date for the 'Call" (row 5) only instead of me doing it on by one evverymonth.

    Hope this is much clearer.

    Thanks
    Attached Files Attached Files

  9. #9
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: formula for year to date position help!

    =SUMPRODUCT(($A$5:$AK$5="Call")*(RIGHT($A$4:$AK$4,LEN($A$4:$AK$4)-7)*1<=$E$1)*($A6:$AK6))

  10. #10
    Forum Contributor
    Join Date
    05-02-2012
    Location
    Mosselbaai, Suid Afrika
    MS-Off Ver
    Excel 2016
    Posts
    107

    Re: formula for year to date position help!

    Quote Originally Posted by nflsales View Post
    =SUMPRODUCT(($A$5:$AK$5="Call")*(RIGHT($A$4:$AK$4,LEN($A$4:$AK$4)-7)*1<=$E$1)*($A6:$AK6))
    @nflsales:
    Why does the following formula give incorrect results, i.e. why can't "LEN($A4:$AK$4)-7" not be replaced with "1"?

    =SUMPRODUCT(($A$5:$AK$5="Call")*(RIGHT($A$4:$AK$4,1)*1<=$E$1)*($A6:$AK6)),

    also what is the purpose of the multiplication by 1?

    Great Formula!!

    Regards

  11. #11
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: formula for year to date position help!

    if time periods are greater then 10 it will give wrong answer ( for 11 it will take 1, for 12, 2 like that)
    by using right function it will give text to convert the text into number I multiplied with 1.

  12. #12
    Forum Contributor
    Join Date
    03-16-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    135

    Re: formula for year to date position help!

    Hi nflsales

    I have tired your formula elsewhere and I keep getting value not sure why. I have attached a sample of how the spreadsheet looks and in BD show show the value for 'SFDR" when an number is inputted.

    Thanks for your help amazing formula.

    Thanks
    Attached Files Attached Files
    Last edited by vba1234; 12-22-2014 at 12:04 PM. Reason: Forgot attachment Sorry!

  13. #13
    Forum Contributor
    Join Date
    05-02-2012
    Location
    Mosselbaai, Suid Afrika
    MS-Off Ver
    Excel 2016
    Posts
    107

    Re: formula for year to date position help!

    Quote Originally Posted by vba1234 View Post
    Hi nflsales

    I have tired your formula elsewhere and I keep getting value not sure why. I have attached a sample of how the spreadsheet looks and in BD show show the value for 'SFDR" when an number is inputted.

    Thanks for your help amazing formula.

    Thanks
    @vba1234:
    There is nothing wrong with the formula of nflsales, your formula in the attached sample file is supposed to look like:
    =SUMPRODUCT(($C$7:$AM$7="SFDR")*(RIGHT($C$6:$AM$6,LEN($C$6:$AM$6)-6)*1<=$E$1)*($C8:$AM8))

    Where did you get the "13" from??

    Regards,
    Henk

  14. #14
    Forum Contributor
    Join Date
    03-16-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    135

    Re: formula for year to date position help!

    Hi Guys

    Sorry for the delayed responds. Happy New Year

    Thanks for the help much appreciated.

    Thanks :D:D

+ 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. Replies: 1
    Last Post: 12-12-2014, 08:31 AM
  2. [SOLVED] Formula to compare date (including month and year) from a listed date to today's date
    By mhewitson15 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2014, 05:31 PM
  3. Replies: 3
    Last Post: 09-04-2013, 10:49 AM
  4. [SOLVED] Keeping a date as current year, even though formula determines previous year
    By dropanddrive03 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-28-2013, 08:31 PM
  5. 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