Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Length that falls within a length interval?

Hello,

I would greatly appreciate if you could help me witht the following problem.

I have two adjacent length intervals:

Interval 1 goes from 237 Km to 356 Km.
Interval 2 goes from 356 Km to 491 Km.

I also have a table with the daily start and end points of the work done for
that day:

Work on day 1: from 313 Km to 377 Km.
Work on day 2: from 289 Km to 357 Km.
(etc.)

Is there a formula that can calculate what is the daily length that falls
within each interval?

For example:

On day 1:
Work done on interval 1 = 43 Km (356 - 313);
Work done on interval 2 = 21 Km (377 - 356).

On day 2:
Work done on interval 1 = 67 Km (356 - 289);
Work done on interval 2 = 1 Km (357 - 356).

Thank you very much for the help!

--
igor
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Length that falls within a length interval?


Maybe like this:

Code:
--------------------

--A-- -B- ----C---- ----D----
1 Begin End Interval1 Interval2
2 237 356
3 356 491
4 313 377 43 21
5 289 357 67 1
--------------------

In C4 and copied across and down

=MAX(0, MIN(C$3, $B4) - MAX(C$2, $A4) )


--
shg
------------------------------------------------------------------------
shg's Profile: http://www.thecodecage.com/forumz/member.php?userid=13
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30483

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default Length that falls within a length interval?

Well, this will work for the given data, but if I remember right, you had
other possible scenarios in a previous post, and without knowing other
scenarios, can't develop formula to handle those other scenarios.
In my sample, I have interval table set up as follows:
J4:K4 = 237 | 356
J5:K5 = 356 | 491

I have your two sets of stop/starts in the following cells
J8:K8 = 313 | 377
J9:K9 = 289 | 357

Formula in L8:
=VLOOKUP(J8,$J$4:$K$5,2)-J8+K8-VLOOKUP(K8,$J$4:$K$5,1)
And this was copied down to L9. This gave the results of 64 & 68 respectively.


--
** John C **


"Igorin" wrote:

Hello,

I would greatly appreciate if you could help me witht the following problem.

I have two adjacent length intervals:

Interval 1 goes from 237 Km to 356 Km.
Interval 2 goes from 356 Km to 491 Km.

I also have a table with the daily start and end points of the work done for
that day:

Work on day 1: from 313 Km to 377 Km.
Work on day 2: from 289 Km to 357 Km.
(etc.)

Is there a formula that can calculate what is the daily length that falls
within each interval?

For example:

On day 1:
Work done on interval 1 = 43 Km (356 - 313);
Work done on interval 2 = 21 Km (377 - 356).

On day 2:
Work done on interval 1 = 67 Km (356 - 289);
Work done on interval 2 = 1 Km (357 - 356).

Thank you very much for the help!

--
igor

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Length that falls within a length interval?

Thanks a lot! It works!
--
igor


"shg" wrote:


Maybe like this:

Code:
--------------------

--A-- -B- ----C---- ----D----
1 Begin End Interval1 Interval2
2 237 356
3 356 491
4 313 377 43 21
5 289 357 67 1
--------------------

In C4 and copied across and down

=MAX(0, MIN(C$3, $B4) - MAX(C$2, $A4) )


--
shg
------------------------------------------------------------------------
shg's Profile: http://www.thecodecage.com/forumz/member.php?userid=13
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30483


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Length that falls within a length interval?

Hello, John,

Thank you very much for taking the time to help.

The formula works fine to calculate the total amount, but I need to know
what amount falls inside of each interval.

I think that i will use the formula given by shg.

Thanks anyway for your time!

--
igor


"John C" wrote:

Well, this will work for the given data, but if I remember right, you had
other possible scenarios in a previous post, and without knowing other
scenarios, can't develop formula to handle those other scenarios.
In my sample, I have interval table set up as follows:
J4:K4 = 237 | 356
J5:K5 = 356 | 491

I have your two sets of stop/starts in the following cells
J8:K8 = 313 | 377
J9:K9 = 289 | 357

Formula in L8:
=VLOOKUP(J8,$J$4:$K$5,2)-J8+K8-VLOOKUP(K8,$J$4:$K$5,1)
And this was copied down to L9. This gave the results of 64 & 68 respectively.


--
** John C **


"Igorin" wrote:

Hello,

I would greatly appreciate if you could help me witht the following problem.

I have two adjacent length intervals:

Interval 1 goes from 237 Km to 356 Km.
Interval 2 goes from 356 Km to 491 Km.

I also have a table with the daily start and end points of the work done for
that day:

Work on day 1: from 313 Km to 377 Km.
Work on day 2: from 289 Km to 357 Km.
(etc.)

Is there a formula that can calculate what is the daily length that falls
within each interval?

For example:

On day 1:
Work done on interval 1 = 43 Km (356 - 313);
Work done on interval 2 = 21 Km (377 - 356).

On day 2:
Work done on interval 1 = 67 Km (356 - 289);
Work done on interval 2 = 1 Km (357 - 356).

Thank you very much for the help!

--
igor

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding a string of unknown length in a string of unknown length, Help! Hankjam[_2_] Excel Discussion (Misc queries) 8 July 3rd 08 06:49 PM
Text length Gmata Excel Discussion (Misc queries) 1 December 18th 07 01:22 AM
Validation length, Range length I think I need to rephrase the question Excel Discussion (Misc queries) 5 September 17th 07 06:29 AM
different length columns dsal Excel Discussion (Misc queries) 5 July 5th 05 06:27 PM
Length of employment Kim Excel Worksheet Functions 4 June 1st 05 05:52 PM


All times are GMT +1. The time now is 11:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"