formula to find and display only cells with changing data in specified columns

yourtwizted

New Member
Joined
Feb 7, 2020
Messages
12
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hey Guys,

i have been doing some searching, and i am not all that great at making excel files but i would love to make my job easier. i have an absenteeism/attendance report and an offline report that i am supposed to run and the initial report provides data to following Screenshot(data changed for work confidentiality).
Screen Shot 2020-04-21 at 4.53.07 PM.png

what i would like to do separate the times into Start and End times and only have the employees that have time under "tallies" section be visible.
i have started to work on this slowly(during my gap time at work) and come up with this so far.

Screen Shot 2020-04-21 at 4.53.19 PM.png


As you can see i have it pulling the data and separating it, my problem is that, for convenience's sake i would like only that people that have times in those specified columns. i.e. the "Extra Hours1" column to only show the 4 employees with time in that column.

i have used INDEX and MATCH to locate the employee ID and used LEFT and RIGHT to split the data. is there a formula that i can use that i can use that will only pull the employee ID when there is data in a specified column?
I have tried a few times to try and use IF statements with INDEX and MATCH but i only seem to get errors
if there is confusion please ask! i am happy to share as much as i am legally allowed to :)
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Can't see to well from your screen captures, I would go with something like

=IFERROR(INDEX(extra_hours_1_whole_column,AGGREGATE(15,6,ROW(extra_hours_1)/(extra_hours_1<>""),ROWS(A$1:A1)),"")

Used descriptions as images don't show which rows / columns the data is in. The reference to A$1:A1 should be the cell holding the first formula before you fill down.

Note that I've suggested using the entire column in the INDEX range, i.e. B:B. The other ranges should only use the rows with data (you could include extra rows to cover the maximum that you would need if the amount of data is variable, but don't go to far, no point in setting the formula to 10000 rows if you never need more than 100).

You could index all columns that you need to copy over using the same AGGREGATE array, or use a helper column with just the AGGREGATE array, then refer to the helper column with your index formulas.

=IFERROR(AGGREGATE(15,6,ROW(extra_hours_1)/(extra_hours_1<>""),ROWS(A$1:A1),"")

Then, assuming the above is filled down from A2, use the INDEX formula as below, changing the index column as needed.

=IF(A2="","",INDEX(extra_hours_1_whole_column,A2))

Hope that makes sense.
 
Upvote 0
Can't see to well from your screen captures, I would go with something like

=IFERROR(INDEX(extra_hours_1_whole_column,AGGREGATE(15,6,ROW(extra_hours_1)/(extra_hours_1<>""),ROWS(A$1:A1)),"")

Used descriptions as images don't show which rows / columns the data is in. The reference to A$1:A1 should be the cell holding the first formula before you fill down.

Note that I've suggested using the entire column in the INDEX range, i.e. B:B. The other ranges should only use the rows with data (you could include extra rows to cover the maximum that you would need if the amount of data is variable, but don't go to far, no point in setting the formula to 10000 rows if you never need more than 100).

You could index all columns that you need to copy over using the same AGGREGATE array, or use a helper column with just the AGGREGATE array, then refer to the helper column with your index formulas.

=IFERROR(AGGREGATE(15,6,ROW(extra_hours_1)/(extra_hours_1<>""),ROWS(A$1:A1),"")

Then, assuming the above is filled down from A2, use the INDEX formula as below, changing the index column as needed.

=IF(A2="","",INDEX(extra_hours_1_whole_column,A2))

Hope that makes sense.

i greatly appreciate this! i do apologize that i didn't include the sheet names or cells,
if we were to call the first Screenshot sheet name "RawData", and the second screenshot sheet name "Main", and for the first columns A:A and first row is 1, what would the formula look like?
 
Upvote 0
If nobody else steps in and does it, I'll post the corrected formula when I can, my wifi has gone down and I'm useless at writing formulas on my phone.
 
Upvote 0
The same 3 formulas a earlier, with Z$3:Z3 being the cell that the first formula is going into before you drag / fill as needed. These were based on the first screen capture, the second one is not clear enough to use.

=IFERROR(INDEX(RawData!$J:$J,AGGREGATE(15,6,ROW(RawData!$J$4:$J$21)/(RawData!$J$4:$J$21<>""),ROWS(Z$3:Z3),"")

=IFERROR(AGGREGATE(15,6,ROW(RawData!$J$4:$J$21)/(RawData!$J$4:$J$21<>""),ROWS(Z$3:Z3),"")

=IF(Z3="","",INDEX(RawData!$J:$J,Z3))

It is preferable if you use XL2BB (green button on the reply toolbar) to post samples rather than screenshots, that makes it easier to read, it preserves formatting and we can copy and paste it into excel to test formulas.
 
Upvote 0
thanks for the teachable moment! new to this!

the following is what i currently have for what i would like to just view the data.

Cell Formulas
RangeFormula
A3:A17,E3:E17,I3:I17,M3:M17,Q3:Q17A3=RawData!$A4
B3:B17B3=IFNA(LEFT(INDEX(RawData!$H:$H,MATCH(Main!A3,RawData!$A:$A,0)),5),"no data")
C3:C17C3=IFNA(RIGHT(INDEX(RawData!$H:$H,MATCH(Main!A3,RawData!$A:$A,0)),5),"no data")
D3:D17,H3:H17,L3:L17,P3:P17,T3:T17D3=IFERROR((C3-B3)*24,"0")
F3:F17F3=IFNA(LEFT(INDEX(RawData!$I:$I,MATCH(Main!E3,RawData!$A:$A,0)),5),"no data")
G3:G17G3=IFNA(RIGHT(INDEX(RawData!$I:$I,MATCH(Main!E3,RawData!$A:$A,0)),5),"no data")
J3:J17J3=IFNA(LEFT(INDEX(RawData!$J:$J,MATCH(Main!I3,RawData!$A:$A,0)),5),"no data")
K3:K17K3=IFNA(RIGHT(INDEX(RawData!$J:$J,MATCH(Main!I3,RawData!$A:$A,0)),5),"no data")
N3:N17N3=IFNA(LEFT(INDEX(RawData!$K:$K,MATCH(Main!M3,RawData!$A:$A,0)),5),"no data")
O3:O17O3=IFNA(RIGHT(INDEX(RawData!$K:$K,MATCH(Main!M3,RawData!$A:$A,0)),5),"no data")
R3:R17R3=IFNA(LEFT(INDEX(RawData!$L:$L,MATCH(Main!Q3,RawData!$A:$A,0)),5),"no data")
S3:S17S3=IFNA(RIGHT(INDEX(RawData!$L:$L,MATCH(Main!Q3,RawData!$A:$A,0)),5),"no data")


this is the raw data that the report gives:

Book1.xlsx
ABCDEFGHIJKLMN
1DetailRemoveTallies
2Employee IDName(First Last)DOWScheduleLunchExclude1Exclude2Make-Up Time1Make-Up Time2Extra Hours1Extra Hours2VTO1VTO2Team Meeting/HR1
3
4825John 110:00-19:0014:00-15:00
5695John 24/1910:00-19:0014:00-15:00
6405John 34/1908:00-17:0012:15-13:15
7901John 44/1907:00-17:0010:45-11:4516:00-17:00
8880John 54/1907:00-19:0013:15-14:1507:00-09:1518:15-19:00
9886John 64/1907:00-16:0010:30-11:3007:00-10:3011:30-16:00
10436John 74/1907:00-16:0011:00-12:00
11158John 84/1907:00-16:0010:50-11:5007:00-07:30
12781John 94/1910:00-19:0013:45-14:45
13573John 104/1907:15-17:1512:00-13:0007:15-08:15
14685John 114/1907:00-16:0010:30-11:30
15275John 124/1907:00-16:0010:45-11:45
16629John 134/1907:00-18:1513:00-14:0007:00-09:15
17800John 144/1907:00-16:0010:30-11:30
18578John 154/1907:00-16:0010:30-11:3007:00-08:30
1990John 164/1907:00-16:0010:35-11:35
20100John 174/1910:00-19:0013:45-14:4510:00-13:4514:45-19:00
21894John 184/1907:00-16:0011:30-12:30
RawData


This data is normally seen for weeks at a time(sunday to saturday)
i would like to display only current day data in separate columns at least similar to what i have
 
Upvote 0
Now I'm following what you need, it is a little more complex than I first thought. Bear with me, I'll see what I can do.
 
Upvote 0
I think that this will do what you need, if you set your sheet up with the first 4 formulas (A3:D3 in the table below) then select all 4 cells and copy them right as a group the column references and formatting will adjust automatically.
Book2
ABCDEFGHIJKLMNOPQRST
1Make-Up Time1Make-Up Time2Extra Hours1Extra Hours2VTO1
2Employee IDStart EndTotalEmployee IDStart EndTotalEmployee IDStart EndTotalEmployee IDStart EndTotalEmployee IDStart EndTotal
3        90116:00:0017:00:0001:00:0088018:15:0019:00:0000:45:00    
4        88007:00:0009:15:0002:15:00        
5        57307:15:0008:15:0001:00:00        
6        62907:00:0009:15:0002:15:00        
7                    
Sheet2
Cell Formulas
RangeFormula
A3:A7,Q3:Q7,M3:M7,I3:I7,E3:E7A3=IFERROR(INDEX(RawData!$A:$A,AGGREGATE(15,6,ROW(RawData!$A$4:$A$21)/(INDEX(RawData!$H$4:$N$21,0,MATCH(LOOKUP("zzz",$A$1:A$1),RawData!$H$2:$N$2,0))<>""),ROWS(A$3:A3))),"")
B3:B7,R3:R7,N3:N7,J3:J7,F3:F7B3=IF(A3="","",LEFT(INDEX(RawData!$H:$N,AGGREGATE(15,6,ROW(RawData!$A$4:$A$21)/(INDEX(RawData!$H$4:$N$21,0,MATCH(LOOKUP("zzz",$A$1:B$1),RawData!$H$2:$N$2,0))<>""),ROWS(B$3:B3)),MATCH(LOOKUP("zzz",$A$1:B$1),RawData!$H$2:$N$2,0)),5)+0)
C3:C7,S3:S7,O3:O7,K3:K7,G3:G7C3=IF(A3="","",RIGHT(INDEX(RawData!$H:$N,AGGREGATE(15,6,ROW(RawData!$A$4:$A$21)/(INDEX(RawData!$H$4:$N$21,0,MATCH(LOOKUP("zzz",$A$1:C$1),RawData!$H$2:$N$2,0))<>""),ROWS(C$3:C3)),MATCH(LOOKUP("zzz",$A$1:C$1),RawData!$H$2:$N$2,0)),5)+0)
D3:D7,T3:T7,P3:P7,L3:L7,H3:H7D3=IF(A3="","",MOD(C3-B3,1))
 
Upvote 0

Forum statistics

Threads
1,214,994
Messages
6,122,633
Members
449,092
Latest member
bsb1122

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