Count the same month across multiple columns

UserI

New Member
Joined
Mar 16, 2022
Messages
24
Office Version
  1. 365
Platform
  1. Windows
Hi,
I've got a worksheet with employees in col. A and then their latest 5 salary increases.
Col. B=salary increase effective date 1; col. C=salary increase reason 1; col. D=salary increase % 1; col. E=salary increase effective date 2; col. F=salary increase reason 2; col. G=salary increase % 2; col. H=salary increase effective date 3 and so on.
I need a formula to count how many times a certain month, let's say September, will appear for each individual as effective month for salary change, considering that there could be blanks if no data and the columns with dates are not consecutive.
Thank you in advance for your help.
Best regards.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Sounds interesting to work on, but two things -
  1. First upload a sample data using XL2BB to work upon. Can't go through the hazard of recreating a sample data and then working on a formula to test it.
  2. Second, how to decide which month is to be tested for an employee as it may vary, though, generally it seldom varies in an organization.
 
Upvote 0
Use header to choose which columns are dates, then get month, then sum
Here is a sample:
Book1
ABCDEFGHIJKLMNOPQRS
1NameEffective date Reason%Effective date Reason%Effective date Reason%Effective date Reason%9 <<< month
2Peter01 January 2017xxx10%01 September 2019xxx10%05 September 2021xxx10%01 August 2022xxx10%2 <<< count
3John05 May 2021xxx5%05 May 2021xxx5%05 May 2021xxx5%05 May 2021xxx5%0 <<< count
Sheet1
Cell Formulas
RangeFormula
R2:R3R2=SUM(($B$1:$P$1="Effective date ")*IFERROR(MONTH($B2:$P2)=R$1,0))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
New Microsoft Excel Worksheet.xlsx
A
1Reference month: November 2022
Sheet1
 
Upvote 0
Sounds interesting to work on, but two things -
  1. First upload a sample data using XL2BB to work upon. Can't go through the hazard of recreating a sample data and then working on a formula to test it.
  2. Second, how to decide which month is to be tested for an employee as it may vary, though, generally it seldom varies in an organization.
New Microsoft Excel Worksheet.xlsx
A
1Reference month: November 2022
Sheet1


Hi,

Here is a sample of data.
The reference month is depending when the data it's checked, so we can say it's random.
If I want to check in Novemebr how many salary changes were in July, I wan to be able to do so.

Thank you for your support.
BR
 
Upvote 0
Use header to choose which columns are dates, then get month, then sum
Here is a sample:
Book1
ABCDEFGHIJKLMNOPQRS
1NameEffective date Reason%Effective date Reason%Effective date Reason%Effective date Reason%9 <<< month
2Peter01 January 2017xxx10%01 September 2019xxx10%05 September 2021xxx10%01 August 2022xxx10%2 <<< count
3John05 May 2021xxx5%05 May 2021xxx5%05 May 2021xxx5%05 May 2021xxx5%0 <<< count
Sheet1
Cell Formulas
RangeFormula
R2:R3R2=SUM(($B$1:$P$1="Effective date ")*IFERROR(MONTH($B2:$P2)=R$1,0))
Press CTRL+SHIFT+ENTER to enter array formulas.
Thank you for your reply.
This formula is not working for me.

Best regards
 
Upvote 0

Forum statistics

Threads
1,215,096
Messages
6,123,074
Members
449,094
Latest member
mystic19

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