Advanced CountA?

HomeTek

New Member
Joined
Jan 27, 2017
Messages
42
Office Version
  1. 365
Platform
  1. Windows
Hi,

As you can see in the screen print below, I am using a simple formula to count the number of sports that have been played each day.

The problem is that some teams play more than 1 sport per day.

Can you think of a way I can either improve this formula so that It can tell when more than 1 sport has been entered into a cell or maybe there is a better way to re-design the worksheet to make it easier? I know I could add extra rows so that only 1 sports is allowed to be entered into a cell, but there could be as many as 10 sports played by each team per day and as it will be an ongoing calendar it will get very big very fast.

Many thanks

ASrb63.jpg
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Your linked image isn't comming up.
But this formula will return the number of commas in A1:A10
=SUMPRODUCT(LEN(A1:A10)-LEN(SUBSTITUTE(A1:A10,",","")))

If when multiple sports have been played in a day, and there are mulitple sports entered into a cell with a comma between each sport the total number of sports in A1:A10 would be

=COUNTA(A1:A10)+SUMPRODUCT(LEN(A1:A10)-LEN(SUBSTITUTE(A1:A10,",","")))
 
Upvote 0
Your linked image isn't comming up.
But this formula will return the number of commas in A1:A10
=SUMPRODUCT(LEN(A1:A10)-LEN(SUBSTITUTE(A1:A10,",","")))

If when multiple sports have been played in a day, and there are mulitple sports entered into a cell with a comma between each sport the total number of sports in A1:A10 would be

=COUNTA(A1:A10)+SUMPRODUCT(LEN(A1:A10)-LEN(SUBSTITUTE(A1:A10,",","")))

Thank you very much for this. Much appreciated. This works perfectly. It never even crossed my mind that this would be a way around it.

I'm not too sure why the picture didn't upload, but for completion I'll post it again.


EDIT: Off topic, but I've just noticed that the days say "Thirsday" on the left. That's a bit strange seeing as the only day I typed in was "Monday" and dragged the formula down. I'm pretty sure I have never altered the list in the options. Ah well. I better go and check on that. :D
ASrb63 (1).png
 
Upvote 0
Happy Satireday, with that layout the formula in F4 would be
=COUNTA(A4:E4)+SUMPRODUCT(LEN(A4:E4)-LEN(SUBSTITUTE(A4:E4,",","")))
 
Upvote 0

Forum statistics

Threads
1,214,981
Messages
6,122,565
Members
449,089
Latest member
Motoracer88

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