Populating a table in excel to assess missing timesheet submissions

Northster

New Member
Joined
Aug 21, 2018
Messages
1
Hello,

I am attempting to set up table which will allow me to assess employees who have not submitted a time-sheet.

The raw data is as follows

Employee NumberEmployeeDateHours
1Mr A03/04/20188.00
1Mr A04/04/20188.00
1Mr A05/04/20188.00
5Mr B03/04/20188.00
5Mr B04/04/20188.00
5Mr B05/04/20188.00
5Mr B06/04/20188.00
6Mrs C03/04/20188.00
6Mrs C04/04/20188.00
6Mrs C05/04/20188.00
8Mr D03/04/20188.00

<tbody>
</tbody>
The data to be presented is as follows,

Mr AMr BMrs CMr D
02/04/2018NoNoNoNo
03/04/2018YesYesYesYes
04/04/2018YesYesYesNo
05/04/2018YesYesYesNo
06/04/2018NoYesNoNo

<tbody>
</tbody>

I was wondering if this is possible without using a pivot table

Any help or pointers would be greatly appreciated.

Thanks
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
A simple formula would do the trick. I had your dataset in A1:D12 with headers. Then B18:D18 were the names and A19:A23 were the dates.

then in B19 i put the below formula and dragged it down and accross and got the output you desire.

=IF(COUNTIFS($B$2:$B$12,B$18,$C$2:$C$12,$A19)>0,"Yes","No")
 
Upvote 0
This code creates a second table starting "F1", and based on dates and Names in the first table.
Code:
[COLOR=navy]Sub[/COLOR] MG21Aug25
[COLOR=navy]Dim[/COLOR] Rng [COLOR=navy]As[/COLOR] Range, Dn [COLOR=navy]As[/COLOR] Range, n [COLOR=navy]As[/COLOR] [COLOR=navy]Long,[/COLOR] num [COLOR=navy]As[/COLOR] [COLOR=navy]Long,[/COLOR] Fdate [COLOR=navy]As[/COLOR] Date, Ldate [COLOR=navy]As[/COLOR] Date, Rw [COLOR=navy]As[/COLOR] [COLOR=navy]Long[/COLOR]
[COLOR=navy]Dim[/COLOR] Dt [COLOR=navy]As[/COLOR] Date, Dic [COLOR=navy]As[/COLOR] Object, col [COLOR=navy]As[/COLOR] [COLOR=navy]Long,[/COLOR] K [COLOR=navy]As[/COLOR] Variant, P [COLOR=navy]As[/COLOR] Variant
[COLOR=navy]Set[/COLOR] Rng = Range(Range("B2"), Range("B" & Rows.Count).End(xlUp))
Fdate = Format(Application.Min(Rng.Offset(, 1)), "dd/mm/yyyy")
Ldate = Format(Application.Max(Rng.Offset(, 1)), "dd/mm/yyyy")
Rw = Ldate - Fdate
[COLOR=navy]With[/COLOR] CreateObject("scripting.dictionary")
.CompareMode = vbTextCompare
    [COLOR=navy]For[/COLOR] [COLOR=navy]Each[/COLOR] Dn [COLOR=navy]In[/COLOR] Rng
        [COLOR=navy]If[/COLOR] Not .Exists(Dn.Value) [COLOR=navy]Then[/COLOR] .Add Dn.Value, New Collection
            .Item(CStr(Dn.Value)).Add CStr(Dn.Offset(, 1).Value)
    [COLOR=navy]Next[/COLOR]
    ReDim ray(1 To Rw + 2, 1 To .Count + 1)
        [COLOR=navy]Set[/COLOR] Dic = CreateObject("scripting.dictionary")
            Dic.CompareMode = vbTextCompare
    [COLOR=navy]For[/COLOR] Dt = Fdate To Ldate
        n = n + 1
        Dic(Dt) = (n + 1)
        ray(n + 1, 1) = Dt
    [COLOR=navy]Next[/COLOR] Dt
col = 1
    [COLOR=navy]For[/COLOR] [COLOR=navy]Each[/COLOR] K [COLOR=navy]In[/COLOR] .keys
        col = col + 1
        ray(1, col) = K
            [COLOR=navy]For[/COLOR] [COLOR=navy]Each[/COLOR] P [COLOR=navy]In[/COLOR] .Item(K)
                Dt = P
                ray(Dic(Dt), col) = "Yes"
            [COLOR=navy]Next[/COLOR] P
    [COLOR=navy]Next[/COLOR] K
[COLOR=navy]With[/COLOR] Range("F1").Resize(UBound(ray, 1), UBound(ray, 2))
    .Value = ray
    .Offset(, 1).Resize(, UBound(ray, 2) - 1).SpecialCells(xlCellTypeBlanks).Value = "No"
[COLOR=navy]End[/COLOR] With
[COLOR=navy]End[/COLOR] With
[COLOR=navy]End[/COLOR] [COLOR=navy]Sub[/COLOR]
Regards Mick
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,543
Members
449,089
Latest member
davidcom

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