|
-
Dec 2nd, 2004, 07:45 AM
#1
Thread Starter
New Member
SUM of various expenses per month
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
-
Dec 3rd, 2004, 06:54 AM
#2
Re: SUM of various expenses per month
'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.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Dec 3rd, 2004, 08:15 PM
#3
Re: SUM of various expenses per month
Yes, SUMIF is the correct function for this. I have made a small ex. for you in case you havent solved it yet.
Code:
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)
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|