# Help for excel, calculate division of colums by sums

1. Jun 17, 2016

### late347

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}$

2. Jun 18, 2016

### late347

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

3. Jun 18, 2016

### late347

I think I got it done by writing manually into the box what the function would be

4. Jun 18, 2016

### Pepper Mint

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
Code (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.