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.
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
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks