Best way to calculate?

Dawn1231

New Member
Joined
Mar 26, 2015
Messages
5
I have spent hours trying to figure out the best way to capture some data. This is done on a daily basis.
Need to track for several different employees specific PTO, including vacation, sick, and floating time off.

Then quarterly, I need to take the summary and subtract them. Here's where my coworker has started. She is typing in to the fields 8 V for 8 hours vacation time, 2 S for sick, etc. She has then done a conditional format where it will change the color of the cell dependent on the type of PTO it is.

I don't know the best way to capture this. And I can't get the SumByColor VBA I found online to work, so that's another issue altogether.

I don't want to get stuck overthinking something that could be handled in a much easier way. Suggestions?

I am including sample data below in a mini table.

Thank you in advance



Sample from Dawn.xlsm
ABCDEFGHI
4Last Name1/11/81/151/221/292/52/122/19
5Alfred8 V2 S8 V8 V8 FL2 S3 FL
6Bonnie8 S
7Carol3 FL
8Donnie6 FL8 S3 V6 V6V
9Elena2 S
10Fred2 S
11Gary8 V
Option 3 - Pivot
Cell Formulas
RangeFormula
C4:I4C4=B4+7
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C6:I11Cell Valuecontains "FL"textNO
C6:I11Cell Valuecontains "S"textNO
C6:I11Cell Valuecontains "V"textNO
B5:B11,C5:F5,H5:I5Cell Valuecontains "FL"textNO
B5:B11,C5:F5,H5:I5Cell Valuecontains "S"textNO
B5:B11,C5:F5,H5:I5Cell Valuecontains "V"textNO
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
With Power Query, Unpivot the data and then Group By Function.

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Last Name"}, "Attribute", "Value"),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Unpivoted Other Columns", "Value", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, false), {"Value.1", "Value.2"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Value.1", Int64.Type}, {"Attribute", type date}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Attribute", "Date"}, {"Value.2", "Type PTO"}, {"Value.1", "PTO Value"}}),
    #"Grouped Rows" = Table.Group(#"Renamed Columns", {"Last Name", "Type PTO"}, {{"PTO Summary", each List.Sum([PTO Value]), type nullable number}})
in
    #"Grouped Rows"

Book2
ABCDEFGHI
4Last Name1/1/20221/8/20221/15/20221/22/20221/29/20222/5/20222/12/20222/19/2022
5Alfred8 V2 S8 V8 V8 FL2 S3 FL
6Bonnie8 S
7Carol3 FL
8Donnie6 FL8 S3 V6 V6 V
9Elena2 S
10Fred2 S
11Gary8 V
12
13Last NameType PTOPTO Summary
14AlfredV24
15AlfredS4
16AlfredFL11
17BonnieS8
18CarolFL3
19DonnieFL6
20DonnieS8
21DonnieV15
22ElenaS2
23FredS 2
24GaryV8
Sheet1
 
Upvote 0

Forum statistics

Threads
1,215,235
Messages
6,123,779
Members
449,123
Latest member
StorageQueen24

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