Count "X" by matrice or Vba

Maurizio

Well-known Member
Joined
Oct 15, 2002
Messages
687
Office Version
  1. 2007
Platform
  1. Windows
Hi all,
I need a formula or vba to count "X" in several date (format date dd/mm/yy):

My DB:


02/01/17 03/01/17 04/02/17 07/02/17 05/03/17
luca X X
paolo X X X
luigi X X X X


(wich formula/vba) x result x months--->

january february March
luca 1 1 0
paolo 1 1 1
luigi 1 2 1


Tia.
 
Last edited:

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Maurizio

Well-known Member
Joined
Oct 15, 2002
Messages
687
Office Version
  1. 2007
Platform
  1. Windows
Sorry. But Best so-->

"<html>
<head><style>.intestazioni {font-family : Arial;font-size : 10pt;color : black;text-align : center;font-weight : normal;background : #EBE7D4;}.celle {font-family : Times New Roman;font-size : 10pt;color : black;text-align : center;font-weight : normal;background: white;}</style></head>
******>
<table bgcolor=#C0C0C0 cellspacing=1 width=80% align=center>
<tr class=intestazioni><td width=22>&nbsp</td><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td><td>F</td><td>G</td><td>H</td></tr>
<tr><td class=intestazioni>1</td><td class=celle>db</td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td></tr>
<tr><td class=intestazioni>2</td><td class=celle></td><td class=celle>02/01/17</td><td class=celle>03/01/17</td><td class=celle>04/01/17</td><td class=celle>02/02/17</td><td class=celle>05/02/17</td><td class=celle>03/03/17</td><td class=celle>04/03/17</td></tr>
<tr><td class=intestazioni>3</td><td class=celle>luca</td><td class=celle>X</td><td class=celle></td><td class=celle></td><td class=celle>X</td><td class=celle></td><td class=celle></td><td class=celle></td></tr>
<tr><td class=intestazioni>4</td><td class=celle>paolo</td><td class=celle></td><td class=celle>X</td><td class=celle></td><td class=celle></td><td class=celle>X</td><td class=celle></td><td class=celle>X</td></tr>
<tr><td class=intestazioni>5</td><td class=celle>luigi</td><td class=celle></td><td class=celle></td><td class=celle>X</td><td class=celle></td><td class=celle></td><td class=celle>X</td><td class=celle>X</td></tr>
<tr><td class=intestazioni>6</td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td></tr>
<tr><td class=intestazioni>7</td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td></tr>
<tr><td class=intestazioni>8</td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td></tr>
<tr><td class=intestazioni>9</td><td class=celle>formula:</td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td></tr>
<tr><td class=intestazioni>10</td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td></tr>
<tr><td class=intestazioni>11</td><td class=celle></td><td class=celle>january</td><td class=celle>february</td><td class=celle>March </td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td></tr>
<tr><td class=intestazioni>12</td><td class=celle>luca</td><td class=celle>1</td><td class=celle>1</td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td></tr>
<tr><td class=intestazioni>13</td><td class=celle>paolo</td><td class=celle>1</td><td class=celle>1</td><td class=celle>1</td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td></tr>
<tr><td class=intestazioni>14</td><td class=celle>luigi</td><td class=celle>1</td><td class=celle></td><td class=celle>2</td><td class=celle></td><td class=celle></td><td class=celle></td><td class=celle></td></tr>
</table>
</body></html>"
 
Last edited:

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
In B12 enter, copy across, and down:

=COUNTIFS(INDEX($B$3:$H$5,MATCH($A12,$A$3:$A$5,0),0),"X",$B$2:$H$2,">="&(1&B$11),$B$2:$H$2,"<="&EOMONTH(1&B$11,0))
 

GTO

MrExcel MVP
Joined
Dec 9, 2008
Messages
6,155

ADVERTISEMENT

...deleted, I'm sure Aladin's is much better.
 
Last edited:

Maurizio

Well-known Member
Joined
Oct 15, 2002
Messages
687
Office Version
  1. 2007
Platform
  1. Windows
Thanks Aladin,
simply PERFECT !!!(as always).

Mau.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,624
Messages
5,838,425
Members
430,546
Latest member
CometOz

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