1

I have a tool I am working on using the latest version of Excel (whatever it is) and I have a table which looks like this:

1st table values input by user

I want to take each unique combination of values from the Code and POBox fields from the top table, and make them show in the bottom table only once, with the time and volume columns totaling up in the bottom table for each of those unique combinations. The end result in the bottom table should look something like the following, given the table values above: desired end result

I hope I explained that well enough. Thanks in Advance! I have tried different combinations of the UNIQUE function, XLOOKUP, IF, IFS, CHOOSE, and I am stumped.

1
  • 1
    Where do you get volume from? Commented Nov 18 at 6:18

2 Answers 2

2

Assuming the Volumes come from somewhere else in the data set, why not use a simple pivot table or the PIVOTBY function

enter image description here

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

4 Comments

.....or Groupby
Volume is input by the user on another sheet. The P.O. Box field was just recently added so I am trying to figure out how to incorporate it into this tool. I will likely also need to incorporate the P.O. Box tracker column into the volume sheet as well
Also, I do not have the PIVOTBY function
Then you don't have the latest version of Excel. What version do you have?
1

Sumup Uniques

  • Adjust the inputs in the first row.
=LET(data,A2:E11,ccol,1,pcol,2,scol,3,ecol,4,vcol,5,
    co,INDEX(data,,ccol),
    po,INDEX(data,,pcol),
    u,UNIQUE(HSTACK(co,po)),
    v,HSTACK((INDEX(data,,ecol)-INDEX(data,,scol))*24,INDEX(data,,vcol)),
    m,MAKEARRAY(ROWS(u),COLUMNS(v),LAMBDA(r,c,
        SUM(FILTER(INDEX(v,,c),(co=INDEX(u,r,1))*(po=INDEX(u,r,2)))))),
    HSTACK(u,m))
  • To get Volume before Time, switch the 'value' columns:

    v,HSTACK(INDEX(data,,vcol),(INDEX(data,,ecol)-INDEX(data,,scol))*24),
    

Data and Result

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.