Simplify this formula containing sum(countifs() function

gfdwer2

New Member
Joined
Jan 22, 2020
Messages
24
Office Version
  1. 2016
  2. 2010
Platform
  1. MacOS
I NEED THIS FORMULA TO BE SIMPLIFIED BECAUSE IT TAKES A LOT OF TIME FOR EXCEL TO COMPUTE IT

Simple background, I need to count all the cells containing "OT 1","OT 2","OT 3","OT 4","OT 5","OT 6" from 7 columns (PROC1-7) , but only for a specific date (represented by A5)

=SUM(COUNTIFS(DATE,A5,PROC1,{"OT 1","OT 2","OT 3","OT 4","OT 5","OT 6"}))+SUM(COUNTIFS(DATE,A5,PROC2,{"OT 1","OT 2","OT 3","OT 4","OT 5","OT 6"}))+SUM(COUNTIFS(DATE,A5,PROC3,{"OT 1","OT 2","OT 3","OT 4","OT 5","OT 6"}))+SUM(COUNTIFS(DATE,A5,PROC4,{"OT 1","OT 2","OT 3","OT 4","OT 5","OT 6"}))+SUM(COUNTIFS(DATE,A5,PROC5,{"OT 1","OT 2","OT 3","OT 4","OT 5","OT 6"}))+SUM(COUNTIFS(DATE,A5,PROC6,{"OT 1","OT 2","OT 3","OT 4","OT 5","OT 6"}))+SUM(COUNTIFS(DATE,A5,PROC7,{"OT 1","OT 2","OT 3","OT 4","OT 5","OT 6"}))

FROM THE FORMULA ABOVE:
1. DATE is a range selection which is Column A from different sheet (DATA)
2. Content of Cell A5 is the first criteria I am looking for in range DATE
3. PROC1 is a range selection which is Column H from different sheet (DATA)
PROC2 is a range selection which is Column K from different sheet (DATA)
PROC3 - PROC7 so on and so forth
4. "OT 1" - "OT 6" are the text I am looking for in range PROC1-PROC7

I have to separate EACH PROC (Column H, Column K, so on so forth) because excel does not allow me to use all the columns at once like H:Z

sample excel sheet can be found in this link: sample.1.xlsm
 
You can simplify with a wildcard then:

=COUNTIFS(DATE,A5,PROC1,"OT *")+COUNTIFS(DATE,A5,PROC2,"OT *")+COUNTIFS(DATE,A5,PROC3,"OT *")+COUNTIFS(DATE,A5,PROC4,"OT *")+COUNTIFS(DATE,A5,PROC5,"OT *")+COUNTIFS(DATE,A5,PROC6,"OT *")+COUNTIFS(DATE,A5,PROC7,"OT *")
YOU ARE THE BOSS THAT ACTUALLY WORKED!!!
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
You can simplify with a wildcard then:

=COUNTIFS(DATE,A5,PROC1,"OT *")+COUNTIFS(DATE,A5,PROC2,"OT *")+COUNTIFS(DATE,A5,PROC3,"OT *")+COUNTIFS(DATE,A5,PROC4,"OT *")+COUNTIFS(DATE,A5,PROC5,"OT *")+COUNTIFS(DATE,A5,PROC6,"OT *")+COUNTIFS(DATE,A5,PROC7,"OT *")
IT DID ACTUALLY SIMPLIFIED THE FORMULA, THE THING IS, I STILL NEED TO LIMIT MY RANGE.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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