Help for excel, calculate division of colums by sums

AI Thread Summary
To calculate the division of values in Excel, a column (J5:J35) is needed where each cell contains the result of dividing the corresponding value in column E by the sum of values in columns E and F (H). The formula for each cell in column J should be J = E / (E + F), which translates to J = E / H. Issues arise when using the "add function" feature, resulting in incorrect outputs of 1 or 0 due to integer formatting. To resolve this, ensure that the cells are formatted as float or double. Alternatively, a VBA macro can be used to automate the calculation, iterating through the rows and performing the division, storing the results in column J. This method ensures accurate results without manual entry.
late347
Messages
300
Reaction score
15
I have column from E5 -->E35 which contains values for each box.
another column from F5-->F35 contains values for each box

I have a sums column, H5-->H35,, which contains values for the sums between the E and F boxes (E5+F5=H5 ;;; E6+F6=H6 etc...)

I want a division column inside J5-->J35 which contains division such that the dividend = E column and the divisor = H column.
the division should be located inside the J column (J5-->J35) ##J= \frac{E}{E+F}=\frac{E}{H}##
 
Computer science news on Phys.org
i tried to add function from the "add function" button and "division" but it did not seem to work.

When I drag down the division function, then I only get 1 and 0 as the results of division, even though it is wrong to say that 1/6 = 0
 
I think I got it done by writing manually into the box what the function would be
 
late347 said:
i tried to add function from the "add function" button and "division" but it did not seem to work.
When I drag down the division function, then I only get 1 and 0 as the results of division, even though it is wrong to say that 1/6 = 0
1/0's are results of integer type so the cells need to be either float or double formatted.
You can also assign your buttons macros. Something simple like this
JavaScript:
Sub Division()
Dim answer As Double
For i = 5 To 35
    answer = Cells(i, "E").Value / (Cells(i, "E").Value + Cells(i, "F").Value)
    Cells(i, "J").Value = answer
Next i
End Sub
Now you can insert code similarly for H formula.
 
In my discussions elsewhere, I've noticed a lot of disagreement regarding AI. A question that comes up is, "Is AI hype?" Unfortunately, when this question is asked, the one asking, as far as I can tell, may mean one of three things which can lead to lots of confusion. I'll list them out now for clarity. 1. Can AI do everything a human can do and how close are we to that? 2. Are corporations and governments using the promise of AI to gain more power for themselves? 3. Are AI and transhumans...
Sorry if 'Profile Badge' is not the correct term. I have an MS 365 subscription and I've noticed on my Word documents the small circle with my initials in it is sometimes different in colour document to document (it's the circle at the top right of the doc, that, when you hover over it it tells you you're signed in; if you click on it you get a bit more info). Last night I had four docs with a red circle, one with blue. When I closed the blue and opened it again it was red. Today I have 3...

Similar threads

3
Replies
100
Views
11K
3
Replies
105
Views
14K
Replies
2
Views
3K
Replies
4
Views
4K
Replies
1
Views
4K
Back
Top