COUNTIF and cell matching the countif

beachsideaccounting

New Member
Joined
Jun 11, 2011
Messages
10
I am trying to make a formula and I have part of it down. Here is the working half. The time sheet has drop down lists with choices of 12 HR REG, 24 HR REG, etc. These are 12&24 hour shifts. The cell next to 12 HR REG (not always in the same cell) is the total number of hours (not always the same number). I would like to add to the COUNTIF the hour number. No two cells are ever the same. This is for a weighted average calculation on a paycheck. :confused:

=COUNTIF('Time Sheet'!B24:H30, "12 HR REG")
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I hope this makes sense, I have listed out

Clock IN | Clock Out | Pay Rate (drop down list) | Total Hours

*under each column is a different time, pay rate, and total hours worked.

On a second sheet I am trying to calculate the weighted average of our pay and I would like to pull over the total hours each day that matches that daily Pay Rate. There could be a different rate and hours 2x in one day. (paramedic/firefighter type work)
 
Upvote 0
Assuming the columns you have listed there correspond to A, B, C, and D, you'd enter

Code:
=sumif(C2:C100,"=12",D2:D100)

Adjust the range to suit your needs, and replace the 12 with whatever code designates the pay rate you are looking for.
 
Upvote 0
that is working perfectly thank you :)

If I may ask, why will my calculations not come out correctly.

When I attempt to add the total of one cell that has a formula in it with another cell that has a formula in it, the balance is off by a few cents.

The formula is ='Time Sheet'!J31*Summary!B16
*Time sheet number is 40, and Summary B16 is 12.56

If I use the above formula I get $502.48

If I manually enter the numbers 40*12.56 I get 502.40 (Correct number) :banghead:
 
Upvote 0
They should calculate the same. Click on each of those cells, go to cell formatting, and change it to "Number", and set the number of decimals to 3 or 4. I suspect there may be some trailing digits after the decimal point that are causing it to calculate to 502.48.
 
Upvote 0
I hope this makes sense, I have listed out

Clock IN | Clock Out | Pay Rate (drop down list) | Total Hours

*under each column is a different time, pay rate, and total hours worked.

On a second sheet I am trying to calculate the weighted average of our pay and I would like to pull over the total hours each day that matches that daily Pay Rate. There could be a different rate and hours 2x in one day. (paramedic/firefighter type work)

Try to provide some examples.

08:15 | 16:15 | 6.8 | 8:00
09:00 | 12:00 | 4.8 | 3:00

Given the foregoing, what result do you expect? If this is not the right data, try to provide a small appropriate set along with the expected result.
 
Upvote 0
Aladin, I have the correct formula now for the previous questions. My only problem is I believe is the rounding issue. I tried changing everything to number, accounting, etc. Also changed decimal points to 2/3/4 still doesn't work but if you just manually enter the numbers it comes out correct.

My overall goal is to create a spreadsheet or multiple shift under multiple payrates, even in the same day, based on a weighted average of pay.
 
Upvote 0
Aladin, I have the correct formula now for the previous questions. My only problem is I believe is the rounding issue. I tried changing everything to number, accounting, etc. Also changed decimal points to 2/3/4 still doesn't work but if you just manually enter the numbers it comes out correct.

My overall goal is to create a spreadsheet or multiple shift under multiple payrates, even in the same day, based on a weighted average of pay.

What is the correct formula you invoke? What result does it return? Try to be specific by referring to some sample.
 
Upvote 0

Forum statistics

Threads
1,224,596
Messages
6,179,807
Members
452,944
Latest member
2558216095

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