Counting 2 columns

want to learn

New Member
Joined
Aug 25, 2007
Messages
33
I need your help!
I have a column (Lets say A) with dates in it and a column (Lets say B) with names in it. I want a formula for counting column A if it = "certain date" and column B if it is = "certain name. Ex, How many times on 8/1/2007 did "john" appear.
Thanks
 

Some videos you may like

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

JazzSP8

Well-known Member
Joined
Sep 30, 2005
Messages
1,223
Office Version
  1. 2013
  2. 2010
Platform
  1. Windows
Hi

Probably needs to change to make it a little more dynamic, but I created this with the Conditonal Sum wizard...
New Microsoft Excel Worksheet.xls
ABCD
1DateNameCount
201/01/2007John2
301/01/2007John
402/01/2007John
503/01/2007Mike
604/01/2007MIke
705/01/2007John
805/01/2007John
Sheet1


HTH :)
 

JazzSP8

Well-known Member
Joined
Sep 30, 2005
Messages
1,223
Office Version
  1. 2013
  2. 2010
Platform
  1. Windows

ADVERTISEMENT

It does work, you can see the example above...

Did you CTRL, SHIFT & ENTER the formula in C2? (See the { }'s?)
 

want to learn

New Member
Joined
Aug 25, 2007
Messages
33
I do not understand the CTRL, SHIFT & ENTER but i did remove the {}'s.
I believe you, it does work on yours.
Here is what I have. =SUM(IF($A$2:$A$8=DATEVALUE("1/1/2007"),IF($B$2:$B$8="John",1,0),0))
 

Jon von der Heyden

MrExcel MVP, Moderator
Joined
Apr 6, 2004
Messages
10,808
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Try:

=SUMPRODUCT((TEXT($A$2:$A$8,"dd/mm/yy")="01/01/07")^1,($B$2:$B$8="John")^1)

This doesn't require ctrl + shift + enter

Regards
Jon
 

JazzSP8

Well-known Member
Joined
Sep 30, 2005
Messages
1,223
Office Version
  1. 2013
  2. 2010
Platform
  1. Windows
Entering a formula with CTRL, SHIFT & ENTER (instead of just ENTER) creates an array formula and encloses it in chevrons ({}'s) which are needed for the formula to work...

Learn more about array formulas here

If your going to need a lot of formulas then you maybe better off trying one of the SUMPRODUCT soloutions though...

:)
 

want to learn

New Member
Joined
Aug 25, 2007
Messages
33
Thanks, Jon von der Heyden That worked.

JazzSP8,
I still would like to know what I am doing wrong on the other formula.
 

JazzSP8

Well-known Member
Joined
Sep 30, 2005
Messages
1,223
Office Version
  1. 2013
  2. 2010
Platform
  1. Windows
See above in case you missed it, we posted at the same time :)
 

Watch MrExcel Video

Forum statistics

Threads
1,123,158
Messages
5,600,054
Members
414,357
Latest member
Gemma_R

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
Top