#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 48
Default fomula to divide

in cell A1 i hv typed the amounts as follows CellA1=37020+400+2676.8+247009.68
and in cell A2 the rates typed are as follows =7.7519+1+49.3945+1
now i need my CellA2 rates to be divide with CellA1 amounts as per arranged
example

RESULT
37020/7.7519 + 400/1 + 2676.8/49.3945 + 247009.68/1
and the expected result is252239.4757

Is there any formula to dividethe CellA1/CellA2 as per the arranged orders,
with out any manually work

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 806
Default fomula to divide

Hello,

I suggest to use this UDF:
Function cellsumdivision(r1 As Range, r2 As Range) As Double
Dim v1, v2
Dim i As Long, d As Double
With Application.WorksheetFunction
v1 = Split(Mid(r1.Formula, 2, 2048), "+")
v2 = Split(Mid(r2.Formula, 2, 2048), "+")
If UBound(v1) = UBound(v2) Then
For i = LBound(v2) To UBound(v2)
d = d + v1(i) / v2(i)
Next i
cellsumdivision = d
Else
cellsumdivision = CVErr(xlErrValue)
End If
End With
End Function

Press ALT + F11, insert a new macro module, copy macro code into it,
go back to worksheet and then use
=cellsumdivision(A1,A2)

Regards,
Bernd
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default fomula to divide


Could you not simply use the mathematical order of operations in conjunction
with brackets to tell what you wanted to divide first?
If I wanted to divide 20 by 2 then it would simply be =20/2

If I wanted to divide that by 2 again after the first function it would be
=(20/2)/2

I think that would work, wouldnt it?

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
If fomula Joe Perez Excel Worksheet Functions 6 April 28th 09 02:27 AM
Help in a fomula Malik Nadeem Excel Discussion (Misc queries) 0 January 10th 09 11:09 AM
Fomula (if?) Jules Excel Worksheet Functions 0 August 8th 06 07:13 PM
IF Fomula DWadding Excel Discussion (Misc queries) 1 August 3rd 05 05:32 PM
Divide one row over other row I dont wont to divide one number Rick Excel Discussion (Misc queries) 0 March 4th 05 07:13 PM


All times are GMT +1. The time now is 04:39 PM.

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"