Help for excel, calculate division of colums by sums

Click For Summary

Discussion Overview

The discussion revolves around calculating the division of values in Excel, specifically dividing values in one column by the sums of two other columns. Participants are exploring how to implement this calculation correctly within a specified range of cells.

Discussion Character

  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant describes the structure of their Excel sheet, detailing columns E, F, and H, and expresses the need for a division column J that calculates the ratio of values in column E to the sums in column H.
  • Another participant reports difficulties with the division function, noting that dragging down the formula results in only 1s and 0s, which they believe is incorrect.
  • A participant claims to have resolved the issue by manually entering the function into the cells.
  • One participant suggests that the issue with getting 1s and 0s may be related to the formatting of the cells, indicating that they should be set to float or double to handle decimal values properly.
  • A suggestion is made to use a macro to automate the division calculation, providing a sample code snippet for implementation.

Areas of Agreement / Disagreement

Participants express varying experiences with the division function in Excel, with some finding success through manual input while others encounter issues. There is no consensus on the best approach to resolve the division calculation problem.

Contextual Notes

Participants mention potential formatting issues with cells affecting the results of the division calculations, but the specifics of these formatting requirements are not fully resolved.

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.
 

Similar threads

  • · Replies 100 ·
4
Replies
100
Views
13K
  • · Replies 105 ·
4
Replies
105
Views
15K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 1 ·
Replies
1
Views
4K