+ Reply to Thread
Results 1 to 9 of 9

sum based on a fluid number

  1. #1
    Registered User
    Join Date
    05-18-2011
    Location
    Kelowna, BC
    MS-Off Ver
    Excel 2003
    Posts
    5

    sum based on a fluid number

    I have a spreadsheet I am working on that I need a formula for. If I have four colums I am working with how would I write the following. Column A is the date based on only workdays which changes for each month, column B is the day of the week based on the date column, column C is the week number in the year based on the date column and column L is the amounts I want to sum based on what week of the year it is. Because the dates and week numbers change for each month, the week number doesnt stay static. So basically I want it to sum column L based on what week number of the year is as it changes month to month. No matter what formula I think of, it doesnt encompass a variable number. See attached spreadsheet.
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: sum based on a fluid number

    Try using the Sumif function
    =SUMIF(L7:L29,C7:C29=19)

    Look here for the syntax.
    http://www.techonthenet.com/excel/formulas/sumif.php

    alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    05-18-2011
    Location
    Kelowna, BC
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: sum based on a fluid number

    Thanks though!
    Last edited by Emmy Lou; 05-18-2011 at 07:26 PM. Reason: posted in wrong spot

  4. #4
    Registered User
    Join Date
    05-18-2011
    Location
    Kelowna, BC
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: sum based on a fluid number

    Thank Alan, that didnt really work. I only want it summing the week on "friday" or the last day of the month which ever comes first. So every Friday there should be a total, then up to 5/31/11 there should be a total. The original formula I wrote =IF(B7="FRIDAY",SUM(L3:L7)," ") worked well until it came to the last couple of days in the month. Then, not so well. Any suggestions?

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: sum based on a fluid number

    How about changing the formula in M7 to

    =IF(MONTH($L$1)<>MONTH(A7), "", IF(DAY(A7)=DAY(EOMONTH($L$1, 0)), SUM(L$7:L7), IF(WEEKDAY(A7) = 6, SUM(L3:L7)," ")))

    The EOMONTH function requires the Analysis ToolPak.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Contributor
    Join Date
    04-01-2009
    Location
    Irvine, CA
    MS-Off Ver
    Excel 2010
    Posts
    280

    Re: sum based on a fluid number

    What about an Offset?

    =IF(B7="FRIDAY",SUM(OFFSET(L7,0,0,-COUNTIF($C:$C,C7),1))," ")

  7. #7
    Registered User
    Join Date
    05-18-2011
    Location
    Kelowna, BC
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: sum based on a fluid number

    Thanks shg, but I dont have the analysis tool pack and would have to get the addition approved by our head office to get it added to my system. I probably need to stay with what I have available. I love the formula though.

  8. #8
    Registered User
    Join Date
    05-18-2011
    Location
    Kelowna, BC
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: sum based on a fluid number

    Thanks Chance2, I love the offset and it works great with the exception of the last few days of the month. For example the month of May has the 30 and 31st that do not total because they are Monday and Tuesday. Any way we can have it take the last day of the month in account?
    Last edited by Emmy Lou; 05-19-2011 at 02:10 PM. Reason: left out "not" in error

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: sum based on a fluid number

    I think that the analysis pack comes with Excel 2003. I think that you only need to activate it. Go to tools, Add-ins and click on the Analysis Tool Pack.

    Alan

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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