Using Excel 2010, attempting to use COUNTIF with Date qualifier & multiple conditions

scapaflow

New Member
Joined
Feb 13, 2013
Messages
4
ABCD
1First NameLast NameTypeDate
2JohnDoeSched Sick1/3/13
3JaneDoeSched Sick1/3/13
4JohnDoeUnsched Sick1/3/13
5JaneDoeUnsched Sick1/3/13
6JohnDoeSched Pers1/3/13
7JaneDoeUnsched Pers1/10/13
8JohnDoeSched Pers1/10/13
9JaneDoeSched Sick1/10/13
10JohnDoeSched Vac1/10/13
11JaneDoeUnsched Vac1/17/13
12JohnDoeUnsched Pers1/17/13
13JaneDoeUnsched1/17/13
14JohnDoeSched Sick1/17/13
15JaneDoeSched Vac1/17/13

<tbody>
</tbody>

FGHI
1Date1/3/131/10/131/17/13
2Scheduled Totals
3Unscheduled Totals
4Combined Totals

<tbody>
</tbody>














Hello! I am attempting to do that which could very easily be done with a pivot table but instead I have manually set up a chart instead for graphing that would take a lot of work to redo - the spreadsheet I am using relies on an import that I do not want to adapt further. I am attempting to set up the counting of instances of various types of absences based on the date and several different names of time off.
I would like the formula to reference the range B:B to see if it matches a cell with the given date in it. If it does, count all instances of specific time - Sick, Personal, Vacation, Unpaid - and provide a total count for each type. If it does not match the date, do not count it.

What would be optimal would be to allow the import of data into the spreadsheet and a simple update for the date in the single cell to allow the COUNTIFS to work and add up the instances for each type. Again this is very much like a pivot table, but because of the design of the spreadsheet it would be more work to change it for how it's integrated.

I have tried IF and COUNTIF statements in cell G2, =IF(D:D=G1,COUNTIF(C:C,"Sched Sick")*COUNTIF(C:C,"Sched Pers")*COUNTIF(C:C,"Sched Vac"))
And COUNTIF - =COUNTIF(A:A,"Sick")*COUNTIF(A:A,"Personal")*COUNTIF(A:A,"Unpaid"), but these didn't work.

The formula for G2:I2 should count all instances of "Sched Sick", "Sched Pers", and "Sched Vac" ONLY if the date in range D:D equals cell G1. It should not count any other value.
The formula for G3:I3 should count all instances of "Unsched Sick", "Unsched Pers", and "Unsched Vac" ONLY if the date in range D:D equals cell G1 and it should not count any other value.

The totals for G2 should be 3
The totals for G3 should be 2
The totals for H2 should be 3
The totals for H3 should be 1
The totals for I2 should be 2
The totals for I3 should be 3


If I import more data for a given date, I should be able to add the date to the next column (it would be J2 on my spreadsheet) and it tabulates the totals automatically.

Any help would be greatly appreciated, thank you in advance for any help!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
how about
E2=LEFT(C2,1)&D2
copy down
G2=COUNTIF($D$2:$D$999,LEFT($F2,1)&G$1)
copy down and across
 
Upvote 0
how about
E2=LEFT(C2,1)&D2
copy down
G2=COUNTIF($D$2:$D$999,LEFT($F2,1)&G$1)
copy down and across

Thank you so much for taking a look and helping! :)

I tried this and entered ($E$2:$E$999, ...) and it worked! Awesome! But I was really looking for a way to get almost an array or sumproduct solution to this that includes the reference to the G1:I1... for the date. And I was trying to get a countif solution that only counts the types of absences like "Sched Sick" or "Unsched Sick" get counted based on my setting up the reference. Because our absence types change periodically I was hoping to be able to just add / edit the array to include new ones and keep the old ones for a cumulative count.
 
Upvote 0

Forum statistics

Threads
1,215,105
Messages
6,123,114
Members
449,096
Latest member
provoking

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