0

Have employee data set with status active and relieved. And the second data set has the time they have reported to the office. Trying to achieve the names of employee who are absent for the day using one formula. I have attached the images for easy understanding. Please find the sheet wherein I have created sample data and formula which I have used. Trying to achieve it using one array formula or query

https://docs.google.com/spreadsheets/d/1Dj7agceCBS_aCm2GVm4EQHqS8_wQYifoKLMcA0fv4fM/edit?usp=sharing

3 Answers 3

0

Have achieved it using Filter and Match

{"Absent For the Day";FILTER((query(importrange("1Dj7agceCBS_aCm2GVm4EQHqS8_wQYifoKLMcA0fv4fM","empdata!A2:B30"),"select Col1 where Col2='Active'")),ISERROR(MATCH((query(importrange("1Dj7agceCBS_aCm2GVm4EQHqS8_wQYifoKLMcA0fv4fM","empdata!A2:B30"),"select Col1 where Col2='Active'")),A2:A20,0)))} 
Sign up to request clarification or add additional context in comments.

Comments

0

try:

=ARRAYFORMULA({"Absent For the Day", ""; SPLIT(FILTER(empdata!A2:A, empdata!B2:B="active", NOT(REGEXMATCH(empdata!A2:A, TEXTJOIN("|", 1, A2:A))))&"♦Absent", "♦")}) 

0

3 Comments

as the emp data is in another worksheet in actual, used import range in place of empdata!A2:A, empdata!B2:B="active" replaced it with below. But it is not working (query(importrange("1Dj7agceCBS_aCm2GVm4EQHqS8_wQYifoKLMcA0fv4fM","empdata!A2:B30"),"select Col1 where Col2='Active'") ,(query(importrange("1Dj7agceCBS_aCm2GVm4EQHqS8_wQYifoKLMcA0fv4fM","empdata!A2:B30"),"select Col1 where Col2='Active'")
@Kanted I see. in that case it would need to be: =ARRAYFORMULA({"Absent For the Day", ""; SPLIT(FILTER(QUERY(IMPORTRANGE("1Dj7agceCBS_aCm2GVm4EQHqS8_wQYifoKLMcA0fv4fM", "empdata!A2:B"), "select Col1 where lower(Col2) = 'active'", 0), QUERY(IMPORTRANGE("1Dj7agceCBS_aCm2GVm4EQHqS8_wQYifoKLMcA0fv4fM", "empdata!A2:B"), "select Col2 where lower(Col2) = 'active'", 0)="active", NOT(REGEXMATCH(QUERY(IMPORTRANGE("1Dj7agceCBS_aCm2GVm4EQHqS8_wQYifoKLMcA0fv4fM", "empdata!A2:B"), "select Col1 where lower(Col2) = 'active'", 0), TEXTJOIN("|", 1, A2:A))))&"♦Absent", "♦")})
i.sstatic.net/Lsw49.png or try the shorter answer bellow
0

try:

=ARRAYFORMULA({"Absent For the Day", ""; SPLIT(QUERY(IMPORTRANGE("1Dj7agceCBS_aCm2GVm4EQHqS8_wQYifoKLMcA0fv4fM", "empdata!A2:B"), "select Col1 where lower(Col2) = 'active' and not Col1 matches '"&TEXTJOIN("|", 1, A2:A)&"'", 0)&"♦Absent", "♦")}) 

0

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.