Countifs

xxsalahxx

Active Member
Joined
Jun 25, 2011
Messages
320
Office Version
  1. 2007
I have a spreadsheet with three columns

Col A = Text ( for the purpose of this lets say apples)

Col B = Numbers (I just need to count how many times a number appears)
Example if the colunm has numbers like 23,15,12, this would count as 3

Col C = Dates ( I need to count how many times a date appears) I don't need dates between just how many cells are showing a date

Im trying to count how many times the word apples appears by numbers in column B by number of dates in column C

Thank you in advance for any help you can give me
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Something like this maybe?


Excel 2013/2016
ABCD
2apples21/3/20182
3bananas1
4oranges1
5apples11/3/2018
6oranges2
7grapes2
8apples2
9apples11/3/2018
10bananas2
11oranges1
12apples21/3/2018
13oranges1
14grapes1
15apples11/3/2018
Sheet1
Cell Formulas
RangeFormula
D2=COUNTIFS(A2:A15,"apples",B2:B15,2,C2:C15,"1/3/18")
 
Upvote 0
Thank you
The number I would be looking for re your example would be 5
as apples I would count once
If there is a number in b column that's a match and there is dates also matching but im getting a zero. any ideas whats wrong?
Thanks you your help is appreciated




Something like this maybe?

Excel 2013/2016
ABCD

<colgroup><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]2[/TD]
[TD="align: center"]apples[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]1/3/2018[/TD]
[TD="align: center"]2[/TD]

[TD="align: center"]3[/TD]
[TD="align: center"]bananas[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]4[/TD]
[TD="align: center"]oranges[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]5[/TD]
[TD="align: center"]apples[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1/3/2018[/TD]
[TD="align: center"][/TD]

[TD="align: center"]6[/TD]
[TD="align: center"]oranges[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]7[/TD]
[TD="align: center"]grapes[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]8[/TD]
[TD="align: center"]apples[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]9[/TD]
[TD="align: center"]apples[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1/3/2018[/TD]
[TD="align: center"][/TD]

[TD="align: center"]10[/TD]
[TD="align: center"]bananas[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]11[/TD]
[TD="align: center"]oranges[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]12[/TD]
[TD="align: center"]apples[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]1/3/2018[/TD]
[TD="align: center"][/TD]

[TD="align: center"]13[/TD]
[TD="align: center"]oranges[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]14[/TD]
[TD="align: center"]grapes[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]15[/TD]
[TD="align: center"]apples[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1/3/2018[/TD]
[TD="align: center"][/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D2[/TH]
[TD="align: left"]=COUNTIFS(A2:A15,"apples",B2:B15,2,C2:C15,"1/3/18")[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Could be the date format. When I first tried it, I got zero as well. After I added the quotes around the date in the formula and formatted the date cells to: DATE "1/3/18", then it worked.

I was just hoping that was something you could live with.
 
Upvote 0
Does it have to be countif or maybe sumproduct? Im still getting a zero result.



Could be the date format. When I first tried it, I got zero as well. After I added the quotes around the date in the formula and formatted the date cells to: DATE "1/3/18", then it worked.

I was just hoping that was something you could live with.
 
Upvote 0
If you're willing to put the specified date into another cell (or maybe it already is), this seems to eliminate the formatting problem:


Excel 2013/2016
ABCDE
1MyDate
2apples21/3/20181/3/20182
3bananas1
4oranges1
5apples11/3/2018
6oranges2
7grapes2
8apples2
9apples11/3/2018
10bananas2
11oranges1
12apples21/3/2018
13oranges1
14grapes1
15apples11/3/2018
Sheet1
Cell Formulas
RangeFormula
E2=COUNTIFS(A2:A15,"apples",B2:B15,2,C2:C15,D2)
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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