Adding number of times code appears in cells over a rolling period

dave6726

Board Regular
Joined
Jul 5, 2007
Messages
63
I have a formula, found elsewhere, that counts the totals of cells from current date – backwards for one year
=SUMIFS($L$5:$BDQ$5,$L$3:$BDQ$3,"<="&F37,$L$3:$BDQ$3,">="&DATE(YEAR(F37)-1,MONTH(F37),DAY(F37)))

Data in $L$5:$BDQ$5
Dates in ,$L$3:$BDQ$3
Todays date in $F$37

This works perfect for numerical values in the cells. However, I have a spread sheet that has “codes” as values in the cells: Two of the codes are “SO” & “S”. I need to count (sum) these as a rolling period from current date to one year previous
Code used for COUNTIF.
=COUNTIF(L5:BDQ5,"=SO")+COUNTIF(L5:BDQ5,"=S")

Unfortunately I cannot work out how integrate the COUNTIF instead of the SUMIFS

Probably just missing something simple? Any helps would be much appreciated
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,968
Office Version
  1. 365
Platform
  1. Windows
I think it would be helpful to see an example of your data, along with your expected results.
 

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,413
Maybe...

=SUM(COUNTIFS($L$5:$BDQ$5,{"S","SO"},$L$3:$BDQ$3,"<="&F37,$L$3:$BDQ$3,">="&DATE(YEAR(F37)-1,MONTH(F37),DAY(F37))))

M.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,133
Messages
5,599,910
Members
414,346
Latest member
mmoose

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