Excel/Google Sheets COUNTIFS formula to count rows, but with a substring in the Range.

rolamento

New Member
Joined
Apr 20, 2023
Messages
14
Office Version
  1. 2016
Platform
  1. Windows
Hello all. I'm having a problem doing a simple COUNTIFS formula. I have to automate a spreadsheet that counts rows if it has the corresponding city, but only if the date is the date from another cell. Lemme post the table bellow:

Book1
ABCDE
1DatestampLocationCurrentDateCityCount
221/07/2024 16:30London21/07/2024London0
321/07/2024 17:53ParisParis0
423/07/2024 19:53BarcelonaNew York0
5Mexico City0
6Barcelona0
Sheet1
Cell Formulas
RangeFormula
E2:E6E2=COUNTIFS(B:B,D2,A:A,"*" & $C$2 & "*")


The first 2 columns are the result of a Google Forms, to count the birth city of people attending a meeting. And I want to consolidate all people that attended said meeting in the last 2 columns, by city. Also, I want to only count given a certain day, so that I could change it on the go to see which people were present in any day of the results. I don't want to create another column with a substring or such, to avoid confusion.

So, basically, I would need, in this mock example, London and Paris to be at 1. If I change the date from "C2" to "23/07/2024", only Barcelona would count to 1. I thought about using something like "LEFT(A:A; 10)" to extract a substring from the Datestamp, so that it would match the date from C2, but it didn't work. Any help would be appreciated! Thanks in advance.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Glad we could help & thanks for the feedback.
 
Upvote 1

Forum statistics

Threads
1,223,877
Messages
6,175,138
Members
452,614
Latest member
MRSWIN2709

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