+ Reply to Thread
Results 1 to 3 of 3

Calculating multiple cells depending on what month it is

  1. #1
    Registered User
    Join Date
    07-17-2011
    Location
    Mesa, Arizona
    MS-Off Ver
    Excel 2003
    Posts
    2

    Post Calculating multiple cells depending on what month it is

    I'm new here, so I am not sure if I can upload an example of my spreadsheet but I will try to explain as best I can should I not be able to upload it.

    I have a cell I:6 I set the date in 1-Dec-10, then I:2 I have a cell that reads the current date from the computer=Today(), In the cell I:3 it spits out a calculation of the difference of months.

    So that describes the date part. Then for this example I have three months set up with a series of dates in the A, C, E columns. In B, D, F I have a different number entered for that month and that date.

    I want to have the spreadsheet calculate a series of cells depending on the what month it is. For instance I:3 has 7 months in it for July. I want the spreadsheet for the 7 month to add cells B:2 to B10. If it were August I:3 would say 8 months and then the sheet would add D:2 to D:10, and the same for September I;3 would say 9 months and the sheet would add F:2 to F:10.

    The result would populate the cell A:15.

  2. #2
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: Calculating multiple cells depending on what month it is

    Hi

    Welcome to the forum

    I think the attached workbook does what you want.
    There is no need for you entries in column I.
    I inserted a formula in A1 of
    =MONTH(TODAY())

    This can be hidden if you want by using a Custom format for the cell of ;;;

    Then because your data to be summed is in alternate columns, I created a lookup table to determine which column of data to sum. This I placed in range A1:B1 on Sheet2
    .
    The formula in cell A15 then becomes
    =SUM(INDEX($A$1:$Y$10,,VLOOKUP(A1,Sheet2!A1:B12,2,0)))
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  3. #3
    Registered User
    Join Date
    07-17-2011
    Location
    Mesa, Arizona
    MS-Off Ver
    Excel 2003
    Posts
    2

    Thumbs up Re: Calculating multiple cells depending on what month it is

    I love it Roger it's brilliant!!

    Thanks so much for your assistance. I had a really convoluted IF statement at one point and it worked then I messed it up at some point. That's when I deleted what I had and found this web site and decided I need to find someone else to look at my issue.

    You have made this much easier for me and it works! Thanks!

    David

+ 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