Ask Experts Questions for FREE Help !
Ask
    jakester's Avatar
    jakester Posts: 582, Reputation: 165
    Senior Member
     
    #1

    Mar 6, 2010, 07:34 AM
    Excel Function
    I'm trying to figure out a way to Sum charges based upon date criteria and charge type criteria. Here's my problem.

    I keep a spreadsheet for personal finances. I use codes for different charges to easily sum and keep track of categories. Here's what it would look like:

    Date Description Amount Code
    1/15/10 Groceries $50.00 GROC
    1/21/10 Gas $22.50 GAS


    At the end of each month, using a SumIf function, I am able to sum all charges based upon the code but I've been starting fresh each month and deleting the previous month data. I'd like to just keep entering the charges into my spreadsheet and roll up the charges for each given month. Can I add another condition to my sumif function that will sum for a given date period (Jan 1 - Jan 31, Feb 1 - Feb 28) based upon that particular code?

    Thanks.
    JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #2

    Mar 6, 2010, 11:04 AM

    In place of the SUMIF(), you'll need to construct a SUMPRODUCT() to replace it.

    Code:
         A		   B		  C	 D	E	 G	  H
    1   Date	Description	Amount	Code		Start	1/1/2010
    2  1/15/2010	 Groceries	$50.00 	GROC		End	1/31/2010
    3  1/21/2010	 Gas		$22.50 	GAS	
    4  1/25/2010	 Groceries	$50.00 	GROC		GROC	$100.00 
    5  1/30/2010	 Gas		$22.50 	GAS		GAS	$45.00 
    6  2/13/2010	 Groceries	$50.00 	GROC				
    7  2/13/2010	 Gas		$22.50 	GAS
    The formula for H4 would be:
    =SUMPRODUCT(($D$2:$D$100=G4) * ($A$2:$A$100>=$H$1) * ($A$2:$A$100<=$H$2) * $C$2:$C$100)

    ... copy that formula downward, it will adjust itself for each category.
    jakester's Avatar
    jakester Posts: 582, Reputation: 165
    Senior Member
     
    #3

    Mar 7, 2010, 09:17 AM
    Quote Originally Posted by JBeaucaire View Post
    In place of the SUMIF(), you'll need to construct a SUMPRODUCT() to replace it.

    Code:
         A		   B		  C	 D	E	 G	  H
    1   Date	Description	Amount	Code		Start	1/1/2010
    2  1/15/2010	 Groceries	$50.00 	GROC		End	1/31/2010
    3  1/21/2010	 Gas		$22.50 	GAS	
    4  1/25/2010	 Groceries	$50.00 	GROC		GROC	$100.00 
    5  1/30/2010	 Gas		$22.50 	GAS		GAS	$45.00 
    6  2/13/2010	 Groceries	$50.00 	GROC				
    7  2/13/2010	 Gas		$22.50 	GAS
    The formula for H4 would be:
    =SUMPRODUCT(($D$2:$D$100=G4) * ($A$2:$A$100>=$H$1) * ($A$2:$A$100<=$H$2) * $C$2:$C$100)

    ...copy that formula downward, it will adjust itself for each category.
    Thanks, JB... it worked great!

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search


Check out some similar questions!

Excel count function [ 12 Answers ]

I am trying to count a large group of cells that are colored depending on the data. For example: I want to count the number of red cells which are faults. I tried the countif but not sure how to set the criteria. Thanks for any help.

Excel If function using 2 worksheets [ 4 Answers ]

I am using Excel 2007. I have created a spreadsheet1 with a list of names and dates. The names and dates can be repeated. I have another spreadsheet 2 with names and formulas. Here the names are not repeated. The formulas adjust the dates for aging purposes. If the name on Spreadsheet 1 equals...

Excel IF function [ 2 Answers ]

I am trying to run the IF function in excel against text rather numerical values. However it does not seem to want to process the argument. Is there a way to get this to work? Cheers

Excel function [ 1 Answers ]

I am looking for a formula that allows me to have a specific text if the value in the cell selected is between 19xx and 19yy. I thought of using IF but can't figure it out... :( If the value is greater than 1967 and less than 1977 value = 30s

Excel Count Function [ 4 Answers ]

In November 2004 Leif 5233 wrote the following regarding counting cells highlighted in a certain colour: ------------------ Create this function: Function CountCol(SumRange As Range, intColor As Integer) As Integer Dim I As Integer Dim Cell As Range Set SumRange =...


View more questions Search