A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Length & Distance formula



 
 
Thread Tools Display Modes
  #1  
Old May 29th, 2010, 05:39 PM posted to microsoft.public.excel.misc
Dale G[_2_]
external usenet poster
 
Posts: 128
Default Length & Distance formula

Hi,
I need a formula that will count based on the length of a vehicle, and a
timed distance (counted in seconds) the vehicle is behind another vehicle.
Here’s the breakdown;
Satisfactory result for 40’ = 6 sec, 60' = 8 sec
Less than Satisfactory 40' = 3 sec & 6 sec, & 60'= 4 sec & 8 sec
NOT Satisfactory 40' = 3 sec or less & 60' = 4 sec or less
40’ vehicles can be separated from the 60’ by the vehicle numbers.
All 40’ vehicle numbers will start with 24, 90, and 91.
So I have 3 columns to place a count. Satisfactory in Q3, less than
Satisfactory in R3, and Not Satisfactory in S3.
The vehicle numbers are recorded in column C, and the following distance in
seconds is recorded in G.
If C3 is blank then all will remain blank.
Also, if possible I would like to set a conditional format in column G.
Green for satisfactory, yellow for less than satisfactory and red for not
satisfactory.
Any help is appreciated.
Dale

  #2  
Old May 29th, 2010, 11:41 PM posted to microsoft.public.excel.misc
Bernard Liengme
external usenet poster
 
Posts: 516
Default Length & Distance formula

Suppose you data is in rows 10 to 100

We need a way of know the vehicle length
In H10 enter =(LEFT(C10,2)="24")+(LEFT(C10,2)="90")+(LEFT(C10,2 )="91") and
copy down the column
The 40 footer will return 1, the other will return 0

In Q3 to count all Satisfactory:
=SUMPRODUCT(--(H10:H100=1),--(G10:G100=6))+SUMPRODUCT(--(H10:H100=0),--(G10:G100=8))
In S3 for Less than Satisfactory
=SUMPRODUCT(--(H10:H100=1),--(G10:G1006),--(G10:G100=3))+SUMPRODUCT(--(H10:H100=0),--(G10:G1008),--(G10:G100=4))
In R3 fro Unsatisfactory
=COUNTA(C10:C100)-(Q3+R3)

To hide results if C3 is blank, in Q3 use
=IF(C3="","",=SUMPRODUCT(--(H10:H100=1),--(G10:G100=6))+SUMPRODUCT(--(H10:H100=0),--(G10:G100=8)))
Likewise in other cells

For the green condition in G column; select all the G data and use this
formula in thee conditional formatting dialog
=OR(AND($H10=1,G10=6),AND($H10=0,G10=8)) and set fill or text to green
For yellow
=OR(AND($H10=1,G106,G10=3),AND($H10=0,G108.G10 =4))
For red
=OR(AND($H10=1,G103),AND($H10=0,G104))

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
REMINDER: These newsgroups are about to die. We will all meet again at
http://social.answers.microsoft.com/...ry/officeexcel

"Dale G" wrote in message
...
Hi,
I need a formula that will count based on the length of a vehicle, and a
timed distance (counted in seconds) the vehicle is behind another vehicle.
Here’s the breakdown;
Satisfactory result for 40’ = 6 sec, 60' = 8 sec
Less than Satisfactory 40' = 3 sec & 6 sec, & 60'= 4 sec & 8 sec
NOT Satisfactory 40' = 3 sec or less & 60' = 4 sec or less
40’ vehicles can be separated from the 60’ by the vehicle numbers.
All 40’ vehicle numbers will start with 24, 90, and 91.
So I have 3 columns to place a count. Satisfactory in Q3, less than
Satisfactory in R3, and Not Satisfactory in S3.
The vehicle numbers are recorded in column C, and the following distance
in
seconds is recorded in G.
If C3 is blank then all will remain blank.
Also, if possible I would like to set a conditional format in column G.
Green for satisfactory, yellow for less than satisfactory and red for not
satisfactory.
Any help is appreciated.
Dale

  #3  
Old May 30th, 2010, 01:53 AM posted to microsoft.public.excel.misc
Dale G[_2_]
external usenet poster
 
Posts: 128
Default Length & Distance formula

Bernard, Thank you.
These formulas are excellent & work very well. I started at the top & copied
them all the way past my existing data. Now when I add the info all is well.
Only one thing; when I pass my existing data to rows that are not filled with
time and vehicle info the conditionally formatted column is red.
Is there a way to have the column appear blank until after the data is
entered?
Here’s what I’ve done so far.
=(LEFT(C3,2)="24")+(LEFT(C3,2)="90")+(LEFT(C3,2)=" 91")
=IF(C3="","",SUMPRODUCT(--(W3:H3=1),--(G3:G3=6))+SUMPRODUCT(--(W3:H3=0),--(G3:G11000=8)))
=IF(C3="","",SUMPRODUCT(--(W3:H3=1),--(G3:G36),--(G3:G3=3))+SUMPRODUCT(--(W3:H3=0),--(G3:G38),--(G3:G3=4))
=COUNTA(C3:C3)-(Q3+R3)
=OR(AND($W3=1,G3=6),AND($W3=0,G3=8)) green
=OR(AND($W3=1,G36,G3=3),AND($W3=0,G38,G3=4)) yellow
=OR(AND($W3=1,G33),AND($W3=0,G34)) red


"Bernard Liengme" wrote:

Suppose you data is in rows 10 to 100

We need a way of know the vehicle length
In H10 enter =(LEFT(C10,2)="24")+(LEFT(C10,2)="90")+(LEFT(C10,2 )="91") and
copy down the column
The 40 footer will return 1, the other will return 0

In Q3 to count all Satisfactory:
=SUMPRODUCT(--(H10:H100=1),--(G10:G100=6))+SUMPRODUCT(--(H10:H100=0),--(G10:G100=8))
In S3 for Less than Satisfactory
=SUMPRODUCT(--(H10:H100=1),--(G10:G1006),--(G10:G100=3))+SUMPRODUCT(--(H10:H100=0),--(G10:G1008),--(G10:G100=4))
In R3 fro Unsatisfactory
=COUNTA(C10:C100)-(Q3+R3)

To hide results if C3 is blank, in Q3 use
=IF(C3="","",=SUMPRODUCT(--(H10:H100=1),--(G10:G100=6))+SUMPRODUCT(--(H10:H100=0),--(G10:G100=8)))
Likewise in other cells

For the green condition in G column; select all the G data and use this
formula in thee conditional formatting dialog
=OR(AND($H10=1,G10=6),AND($H10=0,G10=8)) and set fill or text to green
For yellow
=OR(AND($H10=1,G106,G10=3),AND($H10=0,G108.G10 =4))
For red
=OR(AND($H10=1,G103),AND($H10=0,G104))

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
REMINDER: These newsgroups are about to die. We will all meet again at
http://social.answers.microsoft.com/...ry/officeexcel

"Dale G" wrote in message
...
Hi,
I need a formula that will count based on the length of a vehicle, and a
timed distance (counted in seconds) the vehicle is behind another vehicle.
Here’s the breakdown;
Satisfactory result for 40’ = 6 sec, 60' = 8 sec
Less than Satisfactory 40' = 3 sec & 6 sec, & 60'= 4 sec & 8 sec
NOT Satisfactory 40' = 3 sec or less & 60' = 4 sec or less
40’ vehicles can be separated from the 60’ by the vehicle numbers.
All 40’ vehicle numbers will start with 24, 90, and 91.
So I have 3 columns to place a count. Satisfactory in Q3, less than
Satisfactory in R3, and Not Satisfactory in S3.
The vehicle numbers are recorded in column C, and the following distance
in
seconds is recorded in G.
If C3 is blank then all will remain blank.
Also, if possible I would like to set a conditional format in column G.
Green for satisfactory, yellow for less than satisfactory and red for not
satisfactory.
Any help is appreciated.
Dale

  #4  
Old May 30th, 2010, 02:44 AM posted to microsoft.public.excel.misc
Dale G[_2_]
external usenet poster
 
Posts: 128
Default Length & Distance formula

I got it.

=OR(AND($G3"",$W3=1,G33),AND($G3"",$W3=0,G34 ))

Thanks again.

"Dale G" wrote:

Bernard, Thank you.
These formulas are excellent & work very well. I started at the top & copied
them all the way past my existing data. Now when I add the info all is well.
Only one thing; when I pass my existing data to rows that are not filled with
time and vehicle info the conditionally formatted column is red.
Is there a way to have the column appear blank until after the data is
entered?
Here’s what I’ve done so far.
=(LEFT(C3,2)="24")+(LEFT(C3,2)="90")+(LEFT(C3,2)=" 91")
=IF(C3="","",SUMPRODUCT(--(W3:H3=1),--(G3:G3=6))+SUMPRODUCT(--(W3:H3=0),--(G3:G11000=8)))
=IF(C3="","",SUMPRODUCT(--(W3:H3=1),--(G3:G36),--(G3:G3=3))+SUMPRODUCT(--(W3:H3=0),--(G3:G38),--(G3:G3=4))
=COUNTA(C3:C3)-(Q3+R3)
=OR(AND($W3=1,G3=6),AND($W3=0,G3=8)) green
=OR(AND($W3=1,G36,G3=3),AND($W3=0,G38,G3=4)) yellow
=OR(AND($W3=1,G33),AND($W3=0,G34)) red


"Bernard Liengme" wrote:

Suppose you data is in rows 10 to 100

We need a way of know the vehicle length
In H10 enter =(LEFT(C10,2)="24")+(LEFT(C10,2)="90")+(LEFT(C10,2 )="91") and
copy down the column
The 40 footer will return 1, the other will return 0

In Q3 to count all Satisfactory:
=SUMPRODUCT(--(H10:H100=1),--(G10:G100=6))+SUMPRODUCT(--(H10:H100=0),--(G10:G100=8))
In S3 for Less than Satisfactory
=SUMPRODUCT(--(H10:H100=1),--(G10:G1006),--(G10:G100=3))+SUMPRODUCT(--(H10:H100=0),--(G10:G1008),--(G10:G100=4))
In R3 fro Unsatisfactory
=COUNTA(C10:C100)-(Q3+R3)

To hide results if C3 is blank, in Q3 use
=IF(C3="","",=SUMPRODUCT(--(H10:H100=1),--(G10:G100=6))+SUMPRODUCT(--(H10:H100=0),--(G10:G100=8)))
Likewise in other cells

For the green condition in G column; select all the G data and use this
formula in thee conditional formatting dialog
=OR(AND($H10=1,G10=6),AND($H10=0,G10=8)) and set fill or text to green
For yellow
=OR(AND($H10=1,G106,G10=3),AND($H10=0,G108.G10 =4))
For red
=OR(AND($H10=1,G103),AND($H10=0,G104))

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
REMINDER: These newsgroups are about to die. We will all meet again at
http://social.answers.microsoft.com/...ry/officeexcel

"Dale G" wrote in message
...
Hi,
I need a formula that will count based on the length of a vehicle, and a
timed distance (counted in seconds) the vehicle is behind another vehicle.
Here’s the breakdown;
Satisfactory result for 40’ = 6 sec, 60' = 8 sec
Less than Satisfactory 40' = 3 sec & 6 sec, & 60'= 4 sec & 8 sec
NOT Satisfactory 40' = 3 sec or less & 60' = 4 sec or less
40’ vehicles can be separated from the 60’ by the vehicle numbers.
All 40’ vehicle numbers will start with 24, 90, and 91.
So I have 3 columns to place a count. Satisfactory in Q3, less than
Satisfactory in R3, and Not Satisfactory in S3.
The vehicle numbers are recorded in column C, and the following distance
in
seconds is recorded in G.
If C3 is blank then all will remain blank.
Also, if possible I would like to set a conditional format in column G.
Green for satisfactory, yellow for less than satisfactory and red for not
satisfactory.
Any help is appreciated.
Dale

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:52 AM.


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