Simple counting question

samilynn

Board Regular
Joined
Jun 24, 2003
Messages
166
Office Version
  1. 2016
Platform
  1. Windows
I think I must have stayed up too late last night, because my brain isn't working today :cautious:. How do I count how many sales were made per day, if I have the dates in Column A, and the sales in Column B? I know it's really simple, but gosh I am having a senior moment

Thanks!

Samantha
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
hi Joe, thank you for the reply, but I can't find on that page what I am looking for. Here is a sample of my data.

I am trying to calculate:
a. how many sales were made per day
b. the average sale per day

It can be in a Pivot Table, or in a formula on a new sheet...

Thank you so much!
 

Attachments

  • Screenshot 2024-04-23 101528.jpg
    Screenshot 2024-04-23 101528.jpg
    43.3 KB · Views: 4
Upvote 0
If you wanted to count the number of positive sales on 4/22/2024, your formula would just look like:
Excel Formula:
=COUNTIFS(A2:A21,"=4/22/2024",B2:B21,">0")

If you wanted to get the average, just use a SUMIF to sum up for the entire date and divide by the count, i.e.
Excel Formula:
=SUMIF(A2:A21,"=4/22/2024",B2:B21)/COUNTIFS(A2:A21,"=4/22/2024",B2:B21,">0")
 
Upvote 0
Thanks Eric. I tried that, but it gives me the average per transaction. I need the average per date.
Then you probably have not set up your criteria correctly.
If you show us the formula you tried, we can probably help you fix it.
 
Upvote 0
Then you probably have not set up your criteria correctly.
If you show us the formula you tried, we can probably help you fix it.
I think I'm getting closer to the issue in my formula. I am using this =SUMPRODUCT(1/COUNTIF(Sheet1!A2:A5000,Sheet1!A2:A5000)) to count the number of unique days. It works if I just select the current range of A2:A21, but I don't want to have to keep manually updating it, so I used A2:A5000, but I get a #DIV/0! when using that range that includes blank rows. Any way around it?
 
Upvote 0
I think there may be a disconnect (or missing details) between the question you posted, and what you are really trying to do, because I thought I knew what you were asking for, but your last post now makes me question that.

I think it would be better to take a different approach here. Show us an example of your data AND your expected results based on that data, and explain the logic, if necessary. Then we are not trying to guess as to what you are ultimately trying to accomplish.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0

Forum statistics

Threads
1,215,417
Messages
6,124,783
Members
449,188
Latest member
Hoffk036

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