I have a simple 2 column sheet that I want to total by date. The difficulty that I have it that the date includes time.
Date/Time | Count
8/19/2010 06:22 | 3
8/19/2010 07:33 | 8
8/19/2010 08:44 | 4
8/20/2010 06:22 | 7
8/20/2010 07:33 | 9
8/20/2010 08:44 | 3
My sheet has over 3000 records and do not want to manual calculate as I know there is an easier way, but cannot figure it out. What I need to do is to total up the count for each day like...
8/19/2010 | 15
8/20/2010 | 19
I'm sure this is simple to someone.
Brian
ADD:
After submitting my question, I thought that eventually I would want to also sum total by month so I might as well ask now.
Example:
January | 89
February | 112
March | 72
etc...
Last edited by brian1968; 08-21-2010 at 07:56 AM. Reason: Solved
If the date were listed in E1, then this formula in F1:
=SUMPRODUCT((INT($A$1:$A$100)=E1)*($B$1:$B$100))
Expand the matching ranges as needed, do not try and use a whole column, just adjust the range to what is needed.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Thank you so much Jerry. The formula worked like a charm. You are awesome!!!
If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Brian, you should really investigate the use of Pivot Tables.
Attached is an example based on your sample data.
If you opt against Pivot Tables (most efficient option) then you should - given your use of XL2007 - use SUMIFS rather than SUMPRODUCT esp. if you have lots of unique dates to return data for - the latter is not efficient used en masse or with big data sets.
If backwards compatibility is an issue then 2 SUMIF functions would be equally viable (or a new field at source which normalises the dates to 1st of month thereby allowing for basic SUMIF)=SUMIFS($A$1:$A$1000,">="&E1,$A$1:$A$1000,"<"&E1+1,$B$1:$B$1000)
FWIW - re: SUMPRODUCT
given the explicit coercion taking place in the above (*) it's imperative that the sum_range (B1:B100) contain no non-numeric values (eg text strings like header values)=SUMPRODUCT((INT($A$1:$A$100)=E1)*($B$1:$B$100))
The alternative / preferred option would be to avoid the explicit coercion of sum_range altogether unless explicitly required, ie:
=SUMPRODUCT(--(INT($A$1:$A$100)=E1),$B$1:$B$100)
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
This is totally awesome. I've never really investigated Pivot Tables before. The attachment was so helpful to show me the possibilities that I will have to learn this feature of Excel.Thank you so very much.
Brian
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks