0

Blue region denotes my raw data. Green region my manipulation and yellow cell the desired result.

I am working on transportation of some employees whose route detail is given in blue region. Login means towards office and logout towards home. Same route ID means that those employees are traveling together in same cab. No of employees suggest how many employees are traveling in each trip.

I want to make a summary report as shown in green region. I want to know with how many employees each employee traveled with - i.e. the yellow highlighted region. The cell shows me that employee d for Login 05:00 shift has either traveled alone or with only one other employee. I want these values for the whole Clubbing column.

To achieve this, I have used the formula shown in formula bar, in the highlighted cell. On pressing F9, I am getting the result like the one in yellow highlighted cell.

But my formula seems a little clumsy. Also, to get comprehensible results, I have to go to each cell in Clubbing column and hit F9 which is unwieldy (this table is small, I have hundreds of thousands of entries).

Is there a more efficient and lucid way of getting this result? Please share. I am also open to VBA solutions.

To clarify, the final output I need is something like this - the values given in R column. enter image description here

5
  • Hi @Sparsh you mean to say that in Q5:Q13,, you want to get for example, As Login and Logout totals reading data from column I & L ! Commented Sep 8, 2020 at 10:30
  • @Rajesh, I want something similar that is in R11 to come in Q11, without having to press F9 in Q11 after writing the formula in Q11.
    – Sparsh
    Commented Sep 8, 2020 at 19:02
  • ,, still not clear to me,,, better share some screen shot (expected result) Commented Sep 9, 2020 at 5:39
  • @RajeshS this is the expected result - column R. For ex, R5 shows that whenever a travelled in Login 05:00 shift, there were 3 people in the cab. R11 shows whenever d tavelled in Login 05:00 shift, he was either alone or with one other person.
    – Sparsh
    Commented Sep 9, 2020 at 10:46
  • Hi @Sparsh ,,, now check my post I've solved the issue. ☺ Commented Sep 10, 2020 at 6:42

1 Answer 1

0

Few array (CSE) formula, combined of INDEX and MATCH wrapped with IFERROR, solves the issue:

:Caveat:

  1. I've used data for date 02/01/2001, because employee E falls in that segment only.
  2. For proper visualization I've applied RED color on data falls in date 02/01/2001.

enter image description here


How it works:

  1. Select A12:E29 and SORT the data on Employee column in Ascending order.

  2. Insert date 02/01/2001 in cell F13.

  3. An array formula in cell G13:

    {=IFERROR(INDEX(B$13:B$29, SMALL(IF(COUNTIF($F$13, $A$13:$A$29), ROW($A$13:$D$29)-MIN(ROW($A$13:$D$29))+1), ROW(A1)), COLUMN(A1)),"")}
    
  4. Enter this array formula in cell H13:

    {=IFERROR(INDEX($C$13:$C$29, SMALL(IF(COUNTIF($F$13, $A$13:$A$29), ROW($A$13:$D$29)-MIN(ROW($A$13:$D$29))+1), ROW(A1)), COLUMN(A1)),"")}
    
  5. An array formula in cell I13:

    {=IFERROR(INDEX($E$13:$E$29, SMALL(IF(COUNTIF($F$13, A$13:A$29), ROW($A$13:$D$29)-MIN(ROW($A$13:$D$29))+1), ROW(A1)), COLUMN(A1)),"")}
    

Note:

  1. Finish above shown array (CSE) formula with Ctrl+Shift+Enter & fill down.
  2. Adjust cell references in the formula as needed.
1
  • Glad to help you @Sparsh ,, keep asking ☺ Commented Sep 30, 2020 at 10:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .