+ Reply to Thread
Results 1 to 9 of 9

Totalling of selected months

  1. #1
    Registered User
    Join Date
    01-15-2007
    Location
    Gateshead, UK
    Posts
    5

    Totalling of selected months

    I have a table with a column for each of the 12 months in the year. A summary sheet shows the totals for the month selected and also the totals for the year-to-date using the same selected month. The User selects the month from a dropdown box.

    I need some code to use the selected month in the sum() calculation for another worksheet. Problem is that sum() doesn't appear to want to accept a named cell (or more probably that I don't know how to write it to do this).

    My calculation looks like this:

    =sum('budget'!$f19:'budget'!namedmonth9)

    where 'budget' is a different sheet and "namedmonth" is the letter corresponding to the column of the user selected month.

    I have got a macro to work as required, but this won't sit within this and many other cells and update when the user selects a different month.

    Any help will be most appreciated.

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Attached is a tiny sample you can adapt to your needs ...
    Attached Files Attached Files
    HTH
    Carim


    Top Excel Links

  3. #3
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667
    Use the SUMIF; example:
    =SUMIF(A2:A6,"<="&DATE(2006,1,4),B2:B6)
    Best regards,

    Ray

  4. #4
    Registered User
    Join Date
    01-15-2007
    Location
    Gateshead, UK
    Posts
    5

    Smile Thanks

    Many thanks for your prompt replies, my problem is now solved and whatismore, I even understand the code!

    Something new to learn every day.

  5. #5
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    That is the purpose of attaching a spreadsheet, having the solution but above all learn and understand something new ...

    Thanks for the feedback

  6. #6
    Registered User
    Join Date
    01-15-2007
    Location
    Gateshead, UK
    Posts
    5

    Further info

    Carim,

    Can you please tell me how to produce the dropdown box in cell A5 of your example, I thought that I had done this in the past, but now cannot find out how to do it?

    Many thanks

    ValleyWatch

  7. #7
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Just highlight the reference range, give it a name (Insert Name Define)
    In Data Validation, Allow List and use the name in the Source area ...

  8. #8
    Registered User
    Join Date
    01-15-2007
    Location
    Gateshead, UK
    Posts
    5

    Thanks Again

    Carim,

    Thank you once again, your help is much appreciated.

    Regards

    ValleyWatch

  9. #9
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    You are welcome ...

    Thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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