Microsoft
Software
Hardware
Network
Question : Trying to Sum of Rows Specified within a Date Range (by Year)
I am trying to sum a row of numbers that are categorized under a certain range. My data looks something like:
12/3/09 1/14/10 7/21/10 12/8/10 2/14/11
Category A $ 1.00 $ 8.00 $ 7.00 $ 8.00 $ 1.00
Category B $11.00 $ 2.00 $ 4.00 $15.00 $11.00
Category C $ 7.00 $ 3.00 $ 7.00 $ 5.00 $ 8.00
Category D $ 1.00 $ 8.00 $ 3.00 $ 4.00 $ 7.00
Category E $ 3.00 $ 9.00 $ 2.00 $ 3.00 $ 5.00
Category F $ 4.00 $ 8.00 $12.00 $ 1.00 $10.00
Also, the user enters a date into another cell, such as "4/12/10".
Challenge: I want to write a formula that would sum all amounts within that year based on the date entered. Specifically, if the user enters 4/12/10, then the formula would sum all amounts in the columns (in this example, the 2nd, 3rd, and 4th) that are within 2010 (1/1/10 to 12/31/10). If the user enters 8/18/09, it would add all amounts in the columns that are in 2009 (1/1/09 to 12/31/2009).
Can anyone help with the formula? I have tried HLOOKUP and SUMIF but I am stuck on how to take a date like 4/12/10 and restrict it to the year (2010).
Thanks for your help
(ps sorry I just saw this was posted in the MS Access zone and I cannot delete it)
Answer : Trying to Sum of Rows Specified within a Date Range (by Year)
Assuming that your table is in cells A1:F8, with that date in cell i1, you can use the following formula in cell G2
=SUMPRODUCT((YEAR($B$1:$
F$1)=YEAR(
$I$1))*B2:
F2)
See attached file.
Thomas
Random Solutions
using date data in =CONCATENATE formula
Windows SharePoint Services HTTP log file, configuration, deletion and "prevention"?
/dev/ch0 not recognized
How to cache a large image?
comp1, comp2, comp3, comp4. Mon1, Mon2, Mon3, Mon4. See body of question.
Print .xml document....ASP
How do I combine multiple spreadsheets into one PivotTable?
Classic ASP Cookie Error
Find and Replace hundreds of line of VBScript code via SQL statement
BIOS not detecting PCIE slot