Counting certain values when certain criterias are met

ochayokan

New Member
Joined
Nov 5, 2015
Messages
2
I'm attempting to count how many times a certain number occurs when certain criterias are met.

Essentially I have a workbook which records employees' (who are assigned in specific group) attendance/hours worked/etc. The workbook also attempts to calculate total hours worked with the following criterias: normal working day, rest days, and holidays.

So in order to achieve this I have two tables.

On one worksheet, I have a table of all employees names, groups and the dates for the year. The values inside are the number of hours worked. They are manually entered.
aDyoRuM.jpg



On another worksheet, is the schedule of holidays and rest days for the year. The constants.
ie4y9ul.jpg


So, what I'm trying to do, for instance, is count all the "4" hours worked where that day is a rest day into a single cell. Is this possible?

So for Jay, he's count would be 1
For Bob, he's count would be 0
For Dan, he's count would be 1

I've tried using a mix of countif(), countifs(), lookup(), if(), and(). But unable to achieve what I want.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
I'm attempting to count how many times a certain number occurs when certain criterias are met.

Essentially I have a workbook which records employees' (who are assigned in specific group) attendance/hours worked/etc. The workbook also attempts to calculate total hours worked with the following criterias: normal working day, rest days, and holidays.

So in order to achieve this I have two tables.

On one worksheet, I have a table of all employees names, groups and the dates for the year. The values inside are the number of hours worked. They are manually entered.
aDyoRuM.jpg



On another worksheet, is the schedule of holidays and rest days for the year. The constants.
ie4y9ul.jpg


So, what I'm trying to do, for instance, is count all the "4" hours worked where that day is a rest day into a single cell. Is this possible?

So for Jay, he's count would be 1
For Bob, he's count would be 0
For Dan, he's count would be 1

I've tried using a mix of countif(), countifs(), lookup(), if(), and(). But unable to achieve what I want.


ochayokan,
Welcome to the forum.
Assuming your data is on Sheet1 and Sheet2…
Put this formula in cell J2 on Sheet1 and copy down:
Code:
=COUNTIFS(Sheet1!$C2:$H2,4,Sheet2!$B$4:$G$4,Sheet1!$B2)

Perpa
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

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