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.
Numbers</SPAN>Route Id</SPAN>CallStartTime</SPAN>Time Bucket</SPAN>
14357</SPAN>33451867</SPAN>14/11/2013 16:11:05</SPAN>0:00:47</SPAN>
14357</SPAN>33444609</SPAN>14/11/2013 16:10:18</SPAN>0:01:52</SPAN>
14357</SPAN>33444405</SPAN>14/11/2013 16:08:26</SPAN>0:00:00</SPAN>
64005</SPAN>33685217</SPAN>17/11/2013 11:36:48</SPAN>11:18:32</SPAN>
64005</SPAN>33682097</SPAN>17/11/2013 00:18:16</SPAN>0:00:00</SPAN>
107540</SPAN>33588041</SPAN>15/11/2013 16:27:47</SPAN>28:46:22</SPAN>
107540</SPAN>33382721</SPAN>14/11/2013 11:41:25</SPAN>22:55:30</SPAN>
107540</SPAN>33244793</SPAN>13/11/2013 12:45:55</SPAN>0:00:00</SPAN>

<TBODY>
</TBODY><COLGROUP><COL><COL><COL><COL></COLGROUP>
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
nickwh34,

Welcome to MrExcel.

Try this...

Excel 2007
ABCD
1NumbersRoute IdCallStartTimeTime Bucket
2143573345186716:11:050:00:47
3143573344460916:10:180:01:52
4143573344440516:08:260:00:00
5640053368521711:36:4811:18:32
6640053368209700:18:160:00:00
71075403358804116:27:4728:46:22
81075403338272111:41:2522:55:30
91075403324479312:45:550:00:00

<COLGROUP><COL style="BACKGROUND-COLOR: #e0e0f0"><COL><COL><COL><COL></COLGROUP><THEAD>
</THEAD><TBODY>
</TBODY>
Sheet1

Worksheet Formulas
CellFormula
D2=IF(A3=A2,C2-C3,0)

<THEAD>
</THEAD><TBODY>
</TBODY>

<TBODY>
</TBODY>


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,216,100
Messages
6,128,824
Members
449,470
Latest member
Subhash Chand

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