#1   Report Post  
J45on
 
Posts: n/a
Default Summation format

1. How do i make excel recognise the format i am using?
The Cell:
A1=1.12.6
to be recognised as 1minute and 12.6 seconds, divided by 1200, thus A2=0.0605

2. How do i sum the two cell below?
A2=1.6L A3=3 (without L)
that is in total A4=4.6L.
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

1. You would need to use worksheet change events and parse it

Private Sub Worksheet_Change(ByVal Target As Range)
Dim part1 As String, part2 As String
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("AA1:AA100")) Is Nothing Then
With Target
part1 = Left(.Value, InStr(1, .Value, ".") - 1)
part2 = Right(.Value, Len(.Value) - InStr(1, .Value, "."))
.Value = (Val(part1) * 60 + Val(part2)) / 1200

End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



2 =SUMPRODUCT(--(SUBSTITUTE(A2:A3,"L","")))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"J45on" wrote in message
...
1. How do i make excel recognise the format i am using?
The Cell:
A1=1.12.6
to be recognised as 1minute and 12.6 seconds, divided by 1200, thus

A2=0.0605

2. How do i sum the two cell below?
A2=1.6L A3=3 (without L)
that is in total A4=4.6L.



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
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
Office2000: Conditional format behaves strangely Arvi Laanemets Excel Discussion (Misc queries) 1 April 7th 05 08:47 AM
Keep custom format in new worksheet Buddy Excel Discussion (Misc queries) 2 March 14th 05 10:03 AM
How to format a date to a different format Laura Excel Discussion (Misc queries) 1 March 5th 05 09:59 PM
copy conditional format as ACTUAL format Dana Zulager Excel Discussion (Misc queries) 7 December 7th 04 11:02 PM


All times are GMT +1. The time now is 01:07 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"