PDA

Click to See Complete Forum and Search --> : SUM of various expenses per month


karambos
Dec 2nd, 2004, 06:45 AM
NOTE TO ADMIN: I originally posted this in the "Classic Visual Basic" Forum and was advised to include it here. I tried to delete it but wasn't allowed. I have nothing against you deleting it where appropriate. Thankyou.

I have a worksheet where column A is the date (in format 01-Jan-2004), column C is the amount spent and column D is what is was spent on.

I would like to find out how much was spent on food each month, how much on travel etc. So I need to be able to say

Where column A = November 2004 AND column D = "Food" SUM all numbers in column C

But I'm a novice at Excel. Would this best be done by writing a function in visual basic or is there a quicker way to do it?

Thanks for any help

Ecniv
Dec 3rd, 2004, 05:54 AM
'sumif' I think will be the function you want.

You could do a pivot to get all the distinct (unique) types then sumif to get totals.

RobDog888
Dec 3rd, 2004, 07:15 PM
Yes, SUMIF is the correct function for this. I have made a small ex. for you in case you havent solved it yet.
1-Jan-04 25 Food
1-Jan-04 50 Food
1-Jan-04 25 Stuff
1-Jan-04 100 Food
1-Jan-04 75 Stuff
1-Feb-04 150 Food
1-Feb-04 200 Stuff
1-Feb-04 25 Food
1-Feb-04 50 Stuff
1-Mar-04 100 Food
1-Mar-04 275 Stuff
1-Mar-04 25 Food
1-Mar-04 25 Food
--------------------------------
500

=SUMIF(D1:D13,"Food",C1:C13)