View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Excel 2002 : How to get the difference in a block of data ?

Assuming you have your columns A and B sorted first on A then on B ascending,
and you place this in B2 and copy down......

=IF(A2=A3,"",B2-VLOOKUP(A2,A:B,2,FALSE))

Vaya con Dios,
Chuck, CABGx3




"Mr. Low" wrote:

Hello Vaya,

Your formula works very wekk when the number of row is consistant at 3.

However this formula does not work when the number of rows of each vehicle
is not consistant as folows:


Vehicle Speedometer Mileage
BBN2361 9,650.00
BBN2361 10,600.00
BBN2631 12,800.00 xxxx
BSK1400 8,500.00
BSK1400 12,500.00
BSK1400 11,500.00
BSK1400 14,200.00
BSK1400 16,800.00
BSK1400 10,250.00 xxxx
BGA2367 12,500.00
BGA2367 12,500.00
BGA2367 12,500.00
BGA2367 16,850.00 xxxx

Is there any other formula of getting the difference other than running a
macro ?

Thanks

Low



--
A36B58K641


"CLR" wrote:

Assuming you have headers in row 1, put this in C4 and copy down.........

=IF(A4=A5,"",B4-B2)

Vaya con Dios,
Chuck, CABGx3



"Mr. Low" wrote:

Dear Sir,

I have the following worksheet data:

A B C D

Vehicle Speedometer Mileage
1 BBN2361 9650
2 BBN2361 10600
3 BBN2631 12800 xxxxx (+B3-B1)
4 BSK1400 8500
5 BSK1400 9320
6 BSK1400 10250 xxxxx (+B6-B4)
7 BGA2367 12500
8 BGA2367 14260
9 BGA2367 16850 xxxxx (+B9-B7)

The mileage is calculated by getting the difference between the last and the
first speedometer reading of the same verhicle.

May I know if there is any formula that I can input at C1 and copy down to
get straight annswer at C3, C6 and C9 ? Other cells in column C is left
blank.


Thanks

Low



--
A36B58K641