0

I have data in the below format (Cols B:E): enter image description here

What I am trying to do is create a new table (Cols L:N) where Date repeats in a single column and the corresponding data , ie, Emp Name and Leave type repeats. I was able to do the same just for 'Date' using the below formula: "=ARRAYFORMULA(QUERY(FLATTEN(IF(DAYS(D4:D32,C4:C32)>=SEQUENCE(1,1000,0),C4:C32+SEQUENCE(1,1000,0),"")),"where Col1 is not null"))"

How can this be achieved using formula? Attaching the required format as well:

enter image description here

1
  • didn't you request GAS solution? Commented Feb 1, 2023 at 19:51

1 Answer 1

1

please try:

=QUERY(INDEX(SPLIT(FLATTEN(B2:B&"|"&E2:E&"|"&MAP(C2:C,D2:D,LAMBDA(c,d,SEQUENCE(1,DAYS(d,c)+1,c,1)))),"|",0,0)),"Select Col1,Col3,Col2 WHERE Col3 IS NOT NULL AND Col2<>''")

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.