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
 
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.
You're right, Joe, I don't think I did a very good job at asking my question.

Per your suggestion, I just downloaded the add-in. Here is my table. I am looking to create the section on the right with formulas that I don't have to keep updating. Thank you!!

DATESALE AMOUNT
04/22/24$50.00AVG NUMBER OF SALES PER DAY7.5
04/22/24$25.00AVG $ SOLD PER DAY$566.19
04/22/24$62.50AVG $ PER SALE$75.49
04/22/24$100.00
04/22/24$196.52
04/22/24$27.17
04/22/24$27.30
04/22/24$95.23
04/22/24$25.00
04/22/24$52.50
04/23/24$100.00
04/23/24$52.48
04/23/24$13.48
04/23/24
04/23/24$288.70
04/23/24$16.49
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
OK, you are not looking amounts from any one single day, but rather averages from ALL days in your list.

Using the techniques found here: Count unique values among duplicates - Microsoft Support
assuming that you data is in range A2:B17, here are the formulas I used on column E to get the results you are showing:

Cell E2:
Excel Formula:
=COUNTIF(B$2:B$17,">0")/SUM(IF(FREQUENCY(A$2:A$17,A$2:A$17)>0,1))

Cell E3:
Excel Formula:
=SUM(B$2:B$17)/SUM(IF(FREQUENCY(A$2:A$17,A$2:A$17)>0,1))

Cell E4:
Excel Formula:
=E3/E2

1713888224193.png
 
Upvote 0
Solution
OK, you are not looking amounts from any one single day, but rather averages from ALL days in your list.

Using the techniques found here: Count unique values among duplicates - Microsoft Support
assuming that you data is in range A2:B17, here are the formulas I used on column E to get the results you are showing:

Cell E2:
Excel Formula:
=COUNTIF(B$2:B$17,">0")/SUM(IF(FREQUENCY(A$2:A$17,A$2:A$17)>0,1))

Cell E3:
Excel Formula:
=SUM(B$2:B$17)/SUM(IF(FREQUENCY(A$2:A$17,A$2:A$17)>0,1))

Cell E4:
Excel Formula:
=E3/E2

View attachment 110388
THANK YOU, JOE!!!!
(I admit I didn't know about the FREQUENCY function).

You rock, thanks again!
 
Upvote 0
You are welcome.
Glad we were able to help!
 
Upvote 0
You are welcome.
Glad we were able to help!
One more question if you don't mind. Can I count not just the cells greater than 0, but also the negatives? (if there was a Return, for example...)
 
Upvote 0
If you want to also count the negatives, change this part:
Excel Formula:
COUNTIF(B$2:B$17,">0")
to this:
Excel Formula:
COUNTIF(B$2:B$17,"<>0")
 
Upvote 0
If you want to also count the negatives, change this part:
Excel Formula:
COUNTIF(B$2:B$17,">0")
to this:
Excel Formula:
COUNTIF(B$2:B$17,"<>0")
I tried that, but if I update the formula to B$2:B$5000, so I don't have to keep changing it as I add more rows, then it also counts the blank rows
 
Upvote 0
Try this instead then:
Excel Formula:
COUNTIF(B$2:B$17,"<>")
 
Upvote 0

Forum statistics

Threads
1,215,410
Messages
6,124,752
Members
449,186
Latest member
HBryant

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