Count "X" by matrice or Vba

Maurizio

Well-known Member
Joined
Oct 15, 2002
Messages
682
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:

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Maurizio

Well-known Member
Joined
Oct 15, 2002
Messages
682
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,203
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,154

ADVERTISEMENT

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

Maurizio

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

Mau.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,898
Messages
5,627,526
Members
416,250
Latest member
darius_rebelo

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