count number of occurances for each date

winrz

Board Regular
Joined
Sep 4, 2002
Messages
106
Cant get this and its bugging me. Problem - if every time you ate an apple, you create a new row with todays date and a '1' under the APPLE column. Some days you may eat several (each instance has its own row) and some days you dont eat any.

Now to graph this - I have a matrix below this one with set up for every day of the year. What I want to do is look up at the original matrix and total the number of apples eaten on 1/1/03 and place that count in the lower matrix (next to 1/1/03 and under APPLES). Then, I want to do the same for 1/2/03 and place that under the last entry. so on and so forth... The problem I find is that there may be several rows with 1/1/03 - and I cant just count the times I see 1/1/03 for I may have eaten a Banana that day.


any ideas - I am struggling with the lookup...
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
winrz said:
Cant get this and its bugging me. Problem - if every time you ate an apple, you create a new row with todays date and a '1' under the APPLE column. Some days you may eat several (each instance has its own row) and some days you dont eat any.

Now to graph this - I have a matrix below this one with set up for every day of the year. What I want to do is look up at the original matrix and total the number of apples eaten on 1/1/03 and place that count in the lower matrix (next to 1/1/03 and under APPLES). Then, I want to do the same for 1/2/03 and place that under the last entry. so on and so forth... The problem I find is that there may be several rows with 1/1/03 - and I cant just count the times I see 1/1/03 for I may have eaten a Banana that day.


any ideas - I am struggling with the lookup...

Maybe a Pivot Table or depending on your worksheet, Sumproduct,
as in

=sumproduct((range=a1)*(range=a2))

where a1 houses 1/1/03 and a2 houses apples
 
Upvote 0
Here you go. Formula thanks to Brian from Maui.
Book1
ABCD
11/1/2003apple
21/1/2003banana
31/1/2003apple
41/2/2003orange
51/2/2003apple
61/2/2003banana
71/3/2003apple
81/3/2003apple
91/3/2003goatcheese
10
11
121/1/20031/2/20031/3/2003
13appleapplegoatcheese
14211
15
Sheet2
 
Upvote 0
Let me revamp my APPLE analogy.
Every time I PURCHASE an apple, I place the price in a new row under APPLE.
Since I have prices - a SUMIF would just total the prices (..i do currently track the totals i paid for apples each day with a sumif) .. but i cant figure out how to count the number of times I bought an apple for a particualr day.
 
Upvote 0
winrz said:
Let me revamp my APPLE analogy.
Every time I PURCHASE an apple, I place the price in a new row under APPLE.
Since I have prices - a SUMIF would just total the prices (..i do currently track the totals i paid for apples each day with a sumif) .. but i cant figure out how to count the number of times I bought an apple for a particualr day.

Could you please post 5 to 10 rows of your data?
 
Upvote 0
I GOT IT. Thanks guys - and to Barrys formula - I think I have captured the number of instances - I used:
=SUMPRODUCT(($A$8:$A$400=$A858)*(B$8:B$400>0))
where $A$8:$A$400 is the room alotted for the user inputted dates
and $A858 is the date to compare to from below
and B$8:B$400 is the range to look for values greater than $0.

How simple - thanks folks..
 
Upvote 0
...or, another possibility:
Book1
EFGHI
1DateAppleOrangeBananaGoatcheese
21/1/20031
31/1/20031
41/1/20031
51/2/20031
61/2/20031
71/2/20031
81/3/20031
91/3/20031
101/3/20032
11
121/1/20031/2/20031/3/2003
13appleappleapple
14212
15orangeorangeorange
16010
17bananabananabanana
18110
19goatcheesegoatcheesegoatcheese
20002
Sheet2
 
Upvote 0

Forum statistics

Threads
1,221,692
Messages
6,161,341
Members
451,697
Latest member
pedroDH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top