Longest Call, Longest Call Phone Number and Longest Call Date

drewmorris

New Member
Joined
Oct 2, 2018
Messages
2
Hi and thank you for all help in advance,

I have a csv. file that I download and it gives me the data like this (not real data):

A B C D
CallDateDialledNumberCallingNumberCallDuration
27/09/2018 10:34018888888880733333333300:04:47
26/09/2018 12:22019999999990722222222200:06:04
26/09/2018 11:50019999999990711111111100:06:13
19/09/2018 16:01018888888880744444444400:04:06
17/09/2018 12:43018888888880755555555500:19:59

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>


If possible, I would like a couple of Formulas which will give me the following:

ABCD
NumberLongest Call Longest Caller NumberLongest Call Date
0188888888800:00:00
XXXXX XXX XXXXX/XX/XX

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
01999999999

For the 'Longest Call' I have tried using the following formula: {=MAX(IF(criteria_range=criteria,value_range))} but it has been giving me '00:00:00' even when there is data.

In summary, I would like a formula for extracting the longest call, longest call number and the date the call was done.

Again thank you for all help.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Welcome to the MrExcel board!

I suspect that you problems might be stemming from data that appears to be numerical but is actually text. Do some investigation with, for example, =ISNUMBER(D2)
Same for column A.

Otherwise, if column D is numerical, your formula works for me, though I have given an alternative in column E that doesn't require the array formula entry.

Excel Workbook
ABCDE
1CallDateDialledNumberCallingNumberCallDuration
227/09/2018 10:3401888888888073333333330:04:47
326/09/2018 12:2201999999999072222222220:06:04
426/09/2018 11:5001999999999071111111110:06:13
519/09/2018 16:0101888888888074444444440:04:06
617/09/2018 12:4301888888888075555555550:19:59
7
8
9NumberLongest CallLongest Caller NumberLongest Call Date
10018888888880:19:590755555555517/09/20180:19:59
11019999999990:06:130711111111126/09/20180:06:13
Calls



One other note:
It would theoretically be possible for a given number in column A in the lower section to have more than one row at the top with equal longest call duration. That would mean more than one possible value for columns C & D for that value.
These formulas will only return one value. Do you need to allow for this possibility & if so, how would you want the multiple results presented?

What version of Excel are you using?
 
Upvote 0
With PowerQuery aka Get&Transform

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"DialledNumber"}, {{"Count", each _, type table}, {"Max", each List.Max([CallDuration]), type number}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Grouped Rows",{{"Max", type time}}),
    #"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Count"})
in
    #"Removed Columns"[/SIZE]
and
Code:
[SIZE=1]let
    Source = Table.NestedJoin(Table1,{"Max"},#"Table1 (2)",{"CallDuration"},"Table1",JoinKind.LeftOuter),
    #"Expanded Table1" = Table.ExpandTableColumn(Source, "Table1", {"CallDate", "CallingNumber"}, {"CallDate", "CallingNumber"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Expanded Table1",{{"CallDate", type datetime}})
in
    #"Changed Type"[/SIZE]

CallDateDialledNumberCallingNumberCallDurationDialledNumberMaxCallDateCallingNumber
27/09/2018 10:34​
1888888888​
7333333333​
00:04:47​
1999999999​
00:06:13​
26/09/2018 11:50​
7111111111​
26/09/2018 12:22​
1999999999​
7222222222​
00:06:04​
1888888888​
00:19:59​
17/09/2018 12:43​
7555555555​
26/09/2018 11:50​
1999999999​
7111111111​
00:06:13​
19/09/2018 16:01​
1888888888​
7444444444​
00:04:06​
17/09/2018 12:43​
1888888888​
7555555555​
00:19:59​
 
Upvote 0
Welcome to the MrExcel board!

I suspect that you problems might be stemming from data that appears to be numerical but is actually text. Do some investigation with, for example, =ISNUMBER(D2)
Same for column A.

Otherwise, if column D is numerical, your formula works for me, though I have given an alternative in column E that doesn't require the array formula entry.

Calls

ABCDE
1CallDateDialledNumberCallingNumberCallDuration
227/09/2018 10:3401888888888073333333330:04:47
326/09/2018 12:2201999999999072222222220:06:04
426/09/2018 11:5001999999999071111111110:06:13
519/09/2018 16:0101888888888074444444440:04:06
617/09/2018 12:4301888888888075555555550:19:59
7
8
9NumberLongest CallLongest Caller NumberLongest Call Date
10018888888880:19:590755555555517/09/20180:19:59
11019999999990:06:130711111111126/09/20180:06:13

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:121px;"><col style="width:104px;"><col style="width:154px;"><col style="width:124px;"><col style="width:76px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
B10{=MAX(IF(B$2:B$6=A10,D2:D6))}
C10=INDEX(C$2:C$6,AGGREGATE(15,6,(ROW(C$2:C$6)-ROW(C$2)+1)/((B$2:B$6=A10)*(D$2:D$6=B10)),1))
D10=INT(INDEX(A$2:A$6,AGGREGATE(15,6,(ROW(C$2:C$6)-ROW(C$2)+1)/((B$2:B$6=A10)*(D$2:D$6=B10)),1)))
E10=AGGREGATE(14,6,D$2:D$6/(B$2:B$6=A10),1)

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4


One other note:
It would theoretically be possible for a given number in column A in the lower section to have more than one row at the top with equal longest call duration. That would mean more than one possible value for columns C & D for that value.
These formulas will only return one value. Do you need to allow for this possibility & if so, how would you want the multiple results presented?

What version of Excel are you using?


This has helped me immensely! Thank you so much for the time you spent. I cannot express how grateful I am.

As a first experience of using this website, I will not be able to recommend you enough to all.

Thanks again.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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