output value of

DDT123

New Member
Joined
Aug 9, 2011
Messages
41
Office Version
  1. 365
Platform
  1. Windows
Greetings - I have 2 worksheets... the source sheet which includes raw data and the report sheet which is presented to leadership.
The source sheet has agent names in column A, project duration in column D, and project description in column E.
The report sheet has an agent's name listed in column A, and the sum of all project durations in column B.

I'm looking for the formula which would lookup or match the agent name listed in column A of the report sheet, find the project which had the longest duration (column D of the source sheet), then output the project description in column C of the report sheet from column E of the source sheet.

Any help with this formula would be greatly appreciated!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Sorry guys, I posted this without finishing the thread title and i don't see how i can edit it or delete it
 
Upvote 0
Try this out:

Source data:
Book1
ABCDE
1Agent nameProj durationProj description
2Jen21qwer
3John14asdf
4Barb7zxcv
5Billy17uiop
6Jen3hjkl
7John10dsgf
8Barb19sdfu
9Jen21tuij
10John3poia
11Barb1wery
12Billy9rtyu
Source


Report:
Excel Formula:
=MAXIFS(Source!$D$2:$D$12,Source!$A$2:$A$12,A2)
Excel Formula:
=XLOOKUP(A2&C2,Source!$A$2:$A$12&Source!$D$2:$D$12,Source!$E$2:$E$12,,)
1720715668995.png
 
Upvote 0
Solution
Another option:

Excel Formula:
=LET(
a,FILTER(Source!D2:E100,Source!A2:A100=Report!A2),
b,CHOOSECOLS(a,1),
FILTER(CHOOSECOLS(a,2),b=MAX(b)))
 
Upvote 0
Try this out:

Source data:
Book1
ABCDE
1Agent nameProj durationProj description
2Jen21qwer
3John14asdf
4Barb7zxcv
5Billy17uiop
6Jen3hjkl
7John10dsgf
8Barb19sdfu
9Jen21tuij
10John3poia
11Barb1wery
12Billy9rtyu
Source


Report:
Excel Formula:
=MAXIFS(Source!$D$2:$D$12,Source!$A$2:$A$12,A2)
Excel Formula:
=XLOOKUP(A2&C2,Source!$A$2:$A$12&Source!$D$2:$D$12,Source!$E$2:$E$12,,)
View attachment 113981

Thank you! This worked great!!
 
Upvote 0
Glad to have helped; thanks for the feedback. Just a note: if there are two projects with the same duration, it will return the description of the first one in the list. For example, in the source data I used, there are two projects of duration 21 for Jen, and it returned only the first one.
 
Upvote 0
Another option:

Excel Formula:
=LET(
a,FILTER(Source!D2:E100,Source!A2:A100=Report!A2),
b,CHOOSECOLS(a,1),
FILTER(CHOOSECOLS(a,2),b=MAX(b)))
I'm learning the new functions using the Excel 365 web app. I expanded my data set to row 100 and compared my formulas to yours. I only get 3 agent names, and have different results for the 2nd and 3rd when it spills. Can you explain what's happening?
1720720460601.png


Book1
ADE
1Agent nameProj durationProj description
2Jen21a
3John14b
4Barb7c
5Billy17d
6Jen3e
7John10f
8Barb19g
9Jen21h
10John3i
11Barb1j
12Billy9k
13Jen28l
14John2m
15Barb17n
16Billy7o
17Jen14p
18John25q
19Barb3r
20Jen8s
21John3t
22Barb3u
23Billy6v
24Jen25w
25John25x
26Barb10y
27Billy9z
28Jen17aa
29John8ab
30Barb23ac
31Jen22ad
32John9ae
33Barb19af
34Billy16ag
35Jen16ah
36John28ai
37Barb6aj
38Billy13ak
39Jen5al
40John3am
41Barb2an
42Jen27ao
43John14ap
44Barb26aq
45Billy5ar
46Jen28as
47John12at
48Barb2au
49Billy17av
50Jen1aw
51John5ax
52Barb4ay
53Jen28az
54John28ba
55Barb10bb
56Billy19bc
57Jen18bd
58John22be
59Barb4bf
60Billy9bg
61Jen27bh
62John8bi
63Barb28bj
64Jen2bk
65John22bl
66Barb3bm
67Billy6bn
68Jen23bo
69John22bp
70Barb14bq
71Billy14br
72Jen5bs
73John25bt
74Barb23bu
75Jen18bv
76John12bw
77Barb1bx
78Billy19by
79Jen18bz
80John7ca
81Barb27cb
82Billy23cc
83Jen14cd
84John7ce
85Barb14cf
86Jen21cg
87John24ch
88Barb10ci
89Billy26cj
90Jen2ck
91John20cl
92Barb1cm
93Billy7cn
94Jen4co
95John4cp
96Barb19cq
97Jen17cr
98John6cs
99Barb19ct
100Billy2cu
Source
 

Attachments

  • 1720720267336.png
    1720720267336.png
    18.7 KB · Views: 1
Upvote 0
What is happening is that the max for "Jen" is there 3 times, i.e. it returns 3 project descriptions for her. I am not sure what should happen in such a case - e.g. CONCAT these outputs?
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top