Filter Data?

Rob_010101

Board Regular
Joined
Jul 24, 2017
Messages
198
Office Version
  1. 365
Platform
  1. Windows
Hello,

I track the whole company's absence on a single excel tracker (excerpt below). At the end of each week, I am required to provide an individual absence report to managers in each location. There are currently 62 in the business across 8 locations and this is hours of work on a Friday.

We use Microsoft Teams, so I was thinking of creating a Teams group for each of the 8 locations and dropping a separate spreadsheet in each group which automatically updates from my main tracker. Absence data is confidential, so location 1 managers can't see who is absent in location 2 for example.

Below is my main tracker (anonymised).
Test Data.xlsx
ABCDEFGHIJKLMNOP
1Employee ID (8 Digit)Employee IDStatusForenameSurnameRoleLocationRegionDate of BirthAge DecimalAge Y/MHire DateLOS DecimalLOS Y/MLast Absence StartTotal Occasions in Current 6 Months
2000000011ActiveBobSmithManagerWheathampstead131/12/199329.4794520529 Years, 5 Months01/01/20220.7808219180 Years, 9 Months19/12/20221
3000000022ActiveAlanCarrShoesmithHarpenden212/01/196360.4684931560 Years, 5 Months01/01/202223.7178082223 Years, 8 Months20/12/20221
4000000033ActiveJacobMoggManagerAmwell318/11/200022.5917808222 Years, 6 Months01/01/20220.9534246580 Years, 11 Months20/12/20221
5000000044ActiveBorisYeltzenShoesmithWheathampstead121/11/198834.5917808234 Years, 6 Months01/01/20225.9780821925 Years, 11 Months20/12/20221
6000000055ActiveBobMortimerManagerGustard Wood419/12/195963.536986363 Years, 5 Months01/01/202232.1342465832 Years, 1 Months10/01/20232
7000000066ActiveDanielSmithManagerHarpenden201/02/199231.3945205531 Years, 4 Months01/01/20220.6246575340 Years, 7 Months19/12/20221
8000000077ActiveTrevorMelikklegundrillaShoesmithAmwell326/02/198538.3287671238 Years, 3 Months01/01/202221.3095890421 Years, 3 Months20/12/20221
9000000088ActiveSeanLockShoesmithWheathampstead111/01/198637.4547945237 Years, 5 Months01/01/20221.5671232881 Years, 6 Months22/12/20221
10000000099ActiveJohnRichardsonShoesmithWheathampstead114/05/197746.1232876746 Years, 1 Months01/01/20223.2931506853 Years, 3 Months22/12/20221
110000001010ActiveRoisinConnertyShoesmithAmwell330/07/199824.8986301424 Years, 10 Months01/01/20220.7342465750 Years, 8 Months22/12/20221
120000001111ActiveKevinKevinsonShoesmithAmwell312/05/197845.1287671245 Years, 1 Months01/01/20223.0246575343 Years, 0 Months22/12/20221
130000001212ActivePeterAndreShoesmithWheathampstead106/09/199230.7972602730 Years, 9 Months01/01/20221.2794520551 Years, 3 Months30/03/20233
140000001313ActiveIanMcKellenShoesmithAmwell322/12/197646.5150684946 Years, 5 Months01/01/20221.413698631 Years, 5 Months19/12/20221
150000001414ActivePaulGascoineShoesmithWheathampstead124/09/198537.7534246637 Years, 8 Months01/01/20221.3753424661 Years, 4 Months15/03/20232
160000001515ActiveRusselBrandShoesmithHarpenden202/07/198636.9835616436 Years, 11 Months01/01/202215.9671232915 Years, 11 Months22/12/20221
170000001616ActiveSarahMillicanShoesmithWheathampstead114/02/198934.3589041134 Years, 4 Months01/01/20221.3561643841 Years, 4 Months03/01/20232
180000001717ActiveKirstyThirstyShoesmithAmwell328/12/199032.4904109632 Years, 5 Months01/01/20221.5095890411 Years, 6 Months16/03/20232
190000001818ActiveStuartEdwardsShoesmithWheathampstead124/06/199033.0027397332 Years, 11 Months01/01/20221.4493150681 Years, 5 Months03/04/20232
200000001919ActiveAndrewMarrShoesmithAmwell318/12/196062.536986362 Years, 5 Months01/01/202217.3232876717 Years, 3 Months11/04/20232
210000002020ActivePatrickSwazeyShoesmithHarpenden221/03/197350.273972650 Years, 2 Months01/01/202231.2904109631 Years, 3 Months28/04/20232
220000002121ActiveJeremyPaxmanShoesmithWheathampstead115/08/197547.8712328847 Years, 10 Months01/01/20222.7534246582 Years, 9 Months25/05/20233
230000002222ActiveRodLiddleShoesmithAmwell328/11/196161.5917808261 Years, 6 Months01/01/20222.8465753422 Years, 10 Months19/12/20221
240000002323ActiveRobBrydonShoesmithWheathampstead127/03/196063.2657534263 Years, 2 Months01/01/20222.5643835622 Years, 6 Months23/12/20221
250000002424ActiveJoeWilkinsonShoesmithAmwell307/02/196360.3972602760 Years, 4 Months01/01/20225.3643835625 Years, 4 Months22/03/20232
260000002525ActiveRobBeckettShoesmithWheathampstead118/04/196261.2054794561 Years, 1 Months01/01/202212.4027397312 Years, 4 Months22/12/20221
270000002626ActiveTeresaGreenShoesmithHarpenden223/10/195567.6958904167 Years, 7 Months01/01/20224.7315068494 Years, 8 Months30/05/20233
Sheet1
Cell Formulas
RangeFormula
A2:A27A2=REPT(0,8-LEN(B2))&B2

Say I wanted extract all Wheathampstead rows from the above onto a separate spreadsheet which automatically updates when the above is updated, how could this be done?

Kind Regards,
Chris
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Simple case of filtering on the Location Column and then copy and paste to a new workbook that can be sent on to Manager. Rinse and Repeat.
 
Upvote 1
Simple case of filtering on the Location Column and then copy and paste to a new workbook that can be sent on to Manager. Rinse and Repeat.
I'm aware it needs to be the filter formula but asking how this is done as I've never used it.

Thanks
 
Upvote 0
Click on the G1 cell, click on Data on the Ribbon, then Filter (or use the proposed shortcut you see)
1687019416078.png


Then, click on the square w/the triangle and deselect (Select All) then select your region.

1687019532031.png
 
Upvote 0
Alternatively, on a new sheet with the headers in place, cell A2 use a formula for FILTER

021623 Misc.xlsx
ABCDEFGHIJKLMNOP
1Employee ID (8 Digit)Employee IDStatusForenameSurnameRoleLocationRegionDate of BirthAge DecimalAge Y/MHire DateLOS DecimalLOS Y/MLast Absence StartTotal Occasions in Current 6 Months
233ActiveJacobMoggManagerAmwell318/11/200022.5917822 Years, 6 Months445620.9534250 Years, 11 Months20/12/20221
377ActiveTrevorMelikklegundrillaShoesmithAmwell326/02/198538.3287738 Years, 3 Months4456221.3095921 Years, 3 Months20/12/20221
41010ActiveRoisinConnertyShoesmithAmwell330/07/199824.8986324 Years, 10 Months445620.7342470 Years, 8 Months22/12/20221
51111ActiveKevinKevinsonShoesmithAmwell32882945.1287745 Years, 1 Months445623.0246583 Years, 0 Months22/12/20221
61313ActiveIanMcKellenShoesmithAmwell322/12/197646.5150746 Years, 5 Months445621.4136991 Years, 5 Months19/12/20221
71717ActiveKirstyThirstyShoesmithAmwell328/12/199032.4904132 Years, 5 Months445621.5095891 Years, 6 Months16/03/20232
81919ActiveAndrewMarrShoesmithAmwell318/12/196062.5369962 Years, 5 Months4456217.3232917 Years, 3 Months452342
92222ActiveRodLiddleShoesmithAmwell328/11/196161.5917861 Years, 6 Months445622.8465752 Years, 10 Months19/12/20221
102424ActiveJoeWilkinsonShoesmithAmwell32319460.3972660 Years, 4 Months445625.3643845 Years, 4 Months22/03/20232
Report
Cell Formulas
RangeFormula
A2:P10A2=FILTER(Absent!A2:P27,Absent!G2:G27="Amwell")
Dynamic array formulas.
 
Upvote 1
Thanks All,

After a think I've managed to sort it, using the filter formula similarly to @kweaver 's second post above.

Kind Regards
 
Upvote 0
The problem with using the filter function, is that a manager can simply change the criteria & see data for another site.
 
Upvote 0
The problem with using the filter function, is that a manager can simply change the criteria & see data for another site.
Correct. To prevent this, I'm protecting each worksheet with a password:

1687022090407.png


and using the following VBA Code to prevent Save As:

VBA Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI Then
    MsgBox "Save As has been disabled for security reasons. Please speak to Chris in HR if you would like a copy", vbInformation
    Cancel = True
End If
End Sub

Even though I've tested Save As and a workbook is saved with the same workbook protections, i'm adding this for an extra layer even though they can just delete the code.

Any holes in this?

Kind Regards,
Chris
 
Last edited:
Upvote 0
It's very easy to bypass sheet protection.
 
Upvote 0
Hasn't that been stopped in recent versions of office? I'm sure I read somewhere they use SHA-256 now?
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,107
Members
453,021
Latest member
Justyna P

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