• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Emp id data day wise row to one coloumn

I have a data emp id in row and there attendance in columns i try but log method . I want that every emp id day wise attendance data come in one Coolum as shared example in result sheet
 

Attachments

  • day wise emp attendance extrct in one coloum.xlsx
    12.8 KB · Views: 11
The formulas I use for such unpivoting exercises are specific to Excel 365 (and 2021)
Code:
= LET(
  m, ROWS(data),
  n, COLUMNS(data),
  k, SEQUENCE(m*n),
  r, 1+QUOTIENT(k-1,n),
  c, 1+MOD(k-1,n),
  INDEX(data,r,c))
The row headers are very much the same
Code:
= LET(
  m, ROWS(data),
  n, COLUMNS(data),
  k, SEQUENCE(m*n),
  r, 1+QUOTIENT(k-1,n),
  c, 1+MOD(k-1,n),
  emp, INDEX(empID,r),
  dt,  TEXT(INDEX(date,c),"dd-mmm-yy"),
  emp & ":" & dt)
In legacy versions of Excel you would need to define the row index 'k' using the ROW function.

Otherwise, you could use PowerQuery
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Emp ID", type text}, {"01-Sep", type text}, {"02-Sep", type text}, {"03-Sep", type text}, {"04-Sep", type text}, {"05-Sep", type text}, {"06-Sep", type text}, {"07-Sep", type text}, {"08-Sep", type text}, {"09-Sep", type text}, {"10-Sep", type text}, {"11-Sep", type text}, {"12-Sep", type text}, {"13-Sep", type text}, {"14-Sep", type text}, {"15-Sep", type text}, {"16-Sep", type text}, {"17-Sep", type text}, {"18-Sep", type text}, {"19-Sep", type text}, {"20-Sep", type text}, {"21-Sep", type text}, {"22-Sep", type text}, {"23-Sep", type text}, {"24-Sep", type text}, {"25-Sep", type text}, {"26-Sep", type text}, {"27-Sep", type text}, {"28-Sep", type text}, {"29-Sep", type text}, {"30-Sep", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Emp ID"}, "Attribute", "Value"),
    #"Merged Columns" = Table.CombineColumns(#"Unpivoted Other Columns",{"Emp ID", "Attribute"},Combiner.CombineTextByDelimiter(":", QuoteStyle.None),"Emp ID : date")
in
    #"Merged Columns"
 
Back
Top