Formula to first find and then sum

Chris Mcarthur

New Member
Joined
Jan 30, 2019
Messages
16
I have a workbook with tabs 1 - 31 representing the days of the month.
On each sheet we have employees name, ID, start time, date, and Comments. I currently have a Summary sheet that pulls over the ID and Comment, if any.

What I now need is something to total, if a person (ID) has a comment, how many comments include the word - "sick", how many are "early" and how many do they have that include the word "late".

so for example: ID 542 has 4 early, 2 late, 0 sick ( for the month of February)
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Can you post some sample data so we can workout a solution?
 
Upvote 0
February
1234
IDCommentIDCommentsIDCommentsIDComments
44729963810 mins early786
4497294505
63830024 mins late4516
45012 mins early5987058
4517585369
70530145261918 mins early'
536742453709
452683861831
453690568832
86130577624 mins early826
93730746314
56882046615
77645 mins early30930 mins early468673
46366145 mins early86517
92624 mins early31289919
46670179222
468316472663
865319880660
89932018 mins early851662
Ok this is a sample of the summary tab it picks up the ID# of each employee and any comments from all tabs 1st, 2nd, etc

I will send over a sample of the first tab.


<tbody>
</tbody>
 
Last edited:
Upvote 0
IDNameStart TimeDateComment
447Sidhu Satwinder
449Sidhu Surinder7:45 Depy
638Simmi Simmi
450Singh Baljinder3:30 PM Fed Py12 mins early
451Singh Balvir2:45 Fedy
705Singh Daljit
536Singh Deep Pal
452Singh GurlalR
453Singh Gurleen
861Singh Gurpratap<strike>9:30 FIll</strike>
937Singh Harmanpreet
568Singh Inderpal
776Singh Ishadeep330pm F Leady45 mins early
463Singh Paramjit7:45 Liney
926Singh Satbir3:30pm Fed Py24 mins early
466Singh Vir
468Skuratow Tamara
865Sran Sukhdeep
899Suyo Conrado8:00 am Cheesey
792Takhar Kulwinder2:30 Bakey
472Takhar Sukhjit-
880Tariq Durr E Sameen8:00 Packy12 mins early
851Tatla Rupinder6:15 Oveny

<colgroup><col span="5"></colgroup><tbody>
</tbody>
 
Upvote 0
Hi Chris,

Maybe this could help? Use a helper table to find & convert full comments into Early/Late or Sick this has to be repeated for all the other tabs.

Then we can add all of the countifs together,


Book1
ABCDEFGHIJK
1IDNameStart TimeDateCommentEarlyLateSickEarlyLateSick
2447Sidhu Satwinder  
3449Sidhu Surinder7:45 Depy
4638Simmi Simmi1
5450Singh Baljinder3:30 PM Fed Py12 mins earlyEarly2
6451Singh Balvir2:45 Fedy
7705Singh Daljit
8536Singh Deep Pal
9452Singh GurlalR
10453Singh Gurleen
11861Singh Gurpratap9:30 FIll
12937Singh Harmanpreet
13568Singh Inderpal
14776Singh Ishadeep330pm F Leady45 mins earlyEarly3
15463Singh Paramjit7:45 Liney
16926Singh Satbir3:30pm Fed Py24 mins earlyEarly2
17466Singh Vir
18468Skuratow Tamara
19865Sran Sukhdeep
20899Suyo Conrado8:00 am Cheesey
21792Takhar Kulwinder2:30 Bakey
22472Takhar Sukhjit-
23880Tariq Durr E Sameen8:00 Packy12 mins earlyEarly1
24851Tatla Rupinder6:15 Oveny
253001
Summary
Cell Formulas
RangeFormula
F2=IF(ISNUMBER(SEARCH(F$1,$E2)),F$1,"")
I2=COUNTIFS($A$2:$A$25,Summary!$A2,$F$2:$F$25,Summary!F$1)+COUNTIFS('1'!$A$2:$A$25,Summary!$A2,'1'!C$2:C$25,Summary!F$1)+COUNTIFS('2'!$A$2:$A$25,Summary!$A2,'2'!C$2:C$25,Summary!F$1)+COUNTIFS('3'!$A$2:$A$25,Summary!$A2,'3'!C$2:C$25,Summary!F$1)+COUNTIFS('4'!$A$2:$A$25,Summary!$A2,'4'!C$2:C$25,Summary!F$1)



Book1
ABCDE
1IDCommentEarlyLateSick
2447 
3449
4638
545012 mins earlyEarly
6451
7705
8536
9452
10453
11861
12937
13568
1477645 mins earlyEarly
15463
1692624 mins earlyEarly
17466
18468
19865
20899
1
Cell Formulas
RangeFormula
C2=IF(ISNUMBER(SEARCH(C$1,$B2)),C$1,"")
 
Upvote 0
hi RasGhul,

so How can I read the whole "countif" formula? its cut off and did you have to type it or is there a way to autofill?

thank-you
Chris
 
Upvote 0
Hi Chris,

Just zoom out the mrexcel page so you can see the whole formula, note that the formula needs to be expanded to how many sheets you are counting (31?)
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,716
Members
448,985
Latest member
chocbudda

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