Nested If and Functions

nickwh34

New Member
Joined
Nov 29, 2013
Messages
7
Hi All

I have a spreadsheet with 2000 rows of information, What i am trying to do check the Numbers column if the cell values match and set the first time of call to 0 i:e the 0 to represent the initial call and then work out the time difference between additional calls in the time bucket field. I:e The difference between inital call and the actual next call time. I can get the formulas to work over 2 cells but if there are 3 or more calls from a number the formulas fall over. Does any one have a formula that can check if the cells either side of a number match then set the first date and time it appears to 0 and every other time after that display the difference.
[TABLE="width: 368"]
<TBODY>[TR]
[TD]Numbers</SPAN>[/TD]
[TD]Route Id</SPAN>[/TD]
[TD]CallStartTime</SPAN>[/TD]
[TD]Time Bucket</SPAN>[/TD]
[/TR]
[TR]
[TD]14357</SPAN>[/TD]
[TD]33451867</SPAN>[/TD]
[TD]14/11/2013 16:11:05</SPAN>[/TD]
[TD]0:00:47</SPAN>[/TD]
[/TR]
[TR]
[TD]14357</SPAN>[/TD]
[TD]33444609</SPAN>[/TD]
[TD]14/11/2013 16:10:18</SPAN>[/TD]
[TD]0:01:52</SPAN>[/TD]
[/TR]
[TR]
[TD]14357</SPAN>[/TD]
[TD]33444405</SPAN>[/TD]
[TD]14/11/2013 16:08:26</SPAN>[/TD]
[TD]0:00:00</SPAN>[/TD]
[/TR]
[TR]
[TD]64005</SPAN>[/TD]
[TD]33685217</SPAN>[/TD]
[TD]17/11/2013 11:36:48</SPAN>[/TD]
[TD]11:18:32</SPAN>[/TD]
[/TR]
[TR]
[TD]64005</SPAN>[/TD]
[TD]33682097</SPAN>[/TD]
[TD]17/11/2013 00:18:16</SPAN>[/TD]
[TD]0:00:00</SPAN>[/TD]
[/TR]
[TR]
[TD]107540</SPAN>[/TD]
[TD]33588041</SPAN>[/TD]
[TD]15/11/2013 16:27:47</SPAN>[/TD]
[TD]28:46:22</SPAN>[/TD]
[/TR]
[TR]
[TD]107540</SPAN>[/TD]
[TD]33382721</SPAN>[/TD]
[TD]14/11/2013 11:41:25</SPAN>[/TD]
[TD]22:55:30</SPAN>[/TD]
[/TR]
[TR]
[TD]107540</SPAN>[/TD]
[TD]33244793</SPAN>[/TD]
[TD]13/11/2013 12:45:55</SPAN>[/TD]
[TD]0:00:00</SPAN>[/TD]
[/TR]
</TBODY><COLGROUP><COL><COL><COL><COL></COLGROUP>[/TABLE]
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
nickwh34,

Welcome to MrExcel.

Try this...

Excel 2007
ABCD
NumbersRoute IdCallStartTimeTime Bucket

<COLGROUP><COL style="BACKGROUND-COLOR: #e0e0f0"><COL><COL><COL><COL></COLGROUP><THEAD>
</THEAD><TBODY>
[TD="align: center"]1[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]14357[/TD]
[TD="align: right"]33451867[/TD]
[TD="align: right"]16:11:05[/TD]
[TD="align: right"]0:00:47[/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]14357[/TD]
[TD="align: right"]33444609[/TD]
[TD="align: right"]16:10:18[/TD]
[TD="align: right"]0:01:52[/TD]

[TD="align: center"]4[/TD]
[TD="align: right"]14357[/TD]
[TD="align: right"]33444405[/TD]
[TD="align: right"]16:08:26[/TD]
[TD="align: right"]0:00:00[/TD]

[TD="align: center"]5[/TD]
[TD="align: right"]64005[/TD]
[TD="align: right"]33685217[/TD]
[TD="align: right"]11:36:48[/TD]
[TD="align: right"]11:18:32[/TD]

[TD="align: center"]6[/TD]
[TD="align: right"]64005[/TD]
[TD="align: right"]33682097[/TD]
[TD="align: right"]00:18:16[/TD]
[TD="align: right"]0:00:00[/TD]

[TD="align: center"]7[/TD]
[TD="align: right"]107540[/TD]
[TD="align: right"]33588041[/TD]
[TD="align: right"]16:27:47[/TD]
[TD="align: right"]28:46:22[/TD]

[TD="align: center"]8[/TD]
[TD="align: right"]107540[/TD]
[TD="align: right"]33382721[/TD]
[TD="align: right"]11:41:25[/TD]
[TD="align: right"]22:55:30[/TD]

[TD="align: center"]9[/TD]
[TD="align: right"]107540[/TD]
[TD="align: right"]33244793[/TD]
[TD="align: right"]12:45:55[/TD]
[TD="align: right"]0:00:00[/TD]

</TBODY>
Sheet1

[TABLE="width: 85%"]
<TBODY>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<THEAD>[TR="bgcolor: #e0e0f0"]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</THEAD><TBODY>[TR]
[TH="width: 10, bgcolor: #e0e0f0"]D2[/TH]
[TD="align: left"]=IF(A3=A2,C2-C3,0)[/TD]
[/TR]
</TBODY>[/TABLE]
[/TD]
[/TR]
</TBODY>[/TABLE]


Time bucket cells formatted [h]:mm:ss;@

Hope that helps.
 
Last edited:
Upvote 0
nickwh34,

Initially, I took it that the data shot you posted was your desired result.

Having re-read your post I'm thinking that you don't want the time difference between successive calls but the difference of each call time compared to the initial call.

That being so, and provided that the Numbers are sorted into unique sets, as posted, then perhaps this is what you need.....


Excel 2007
ABCD
1NumbersRoute IdCallStartTimeTime Bucket
2143573345186714/11/13 16:11:050:02:39
3143573344460914/11/13 16:10:180:01:52
4143573344440514/11/13 16:08:260:00:00
5640053368521717/11/13 11:36:4811:18:32
6640053368209717/11/13 00:18:160:00:00
71075403358804115/11/13 16:27:4774:41:52
81075403338272114/11/13 11:41:2545:55:30
91075403324479313/11/13 12:45:5523:00:00
101075403324479312/11/13 13:45:550:00:00
Sheet1 (2)
Cell Formulas
RangeFormula
D2=IFERROR(IF(A3=A2,C2-INDEX(C:C,(COUNTIF(A:A,A2)-1)+(MATCH(A2,A:A,0)),0),0),"")
 
Upvote 0
[
Steve thanks so much this formula worked a treat spot on and exactly what I wanted can't thank you enough

Nick



QUOTE=Snakehips;3648220]nickwh34,

Initially, I took it that the data shot you posted was your desired result.

Having re-read your post I'm thinking that you don't want the time difference between successive calls but the difference of each call time compared to the initial call.

That being so, and provided that the Numbers are sorted into unique sets, as posted, then perhaps this is what you need.....


Excel 2007
ABCD
1NumbersRoute IdCallStartTimeTime Bucket
2143573345186714/11/13 16:11:050:02:39
3143573344460914/11/13 16:10:180:01:52
4143573344440514/11/13 16:08:260:00:00
5640053368521717/11/13 11:36:4811:18:32
6640053368209717/11/13 00:18:160:00:00
71075403358804115/11/13 16:27:4774:41:52
81075403338272114/11/13 11:41:2545:55:30
91075403324479313/11/13 12:45:5523:00:00
101075403324479312/11/13 13:45:550:00:00
Sheet1 (2)
Cell Formulas
RangeFormula
D2=IFERROR(IF(A3=A2,C2-INDEX(C:C,(COUNTIF(A:A,A2)-1)+(MATCH(A2,A:A,0)),0),0),"")
[/QUOTE]
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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