# If i can get Formula Sytanx right for summing then why not for....

#### NimishK

##### Well-known Member
Anyone who can help me to correct
If i can get Formula Sytanx right for summing

Sheet4.Cells(TotRow, 8).Formula = "=Sum(C" & fRow & ":C" & lRow & ")" as =SUM(C2:C5) in a Cell
then why not for the following
Sheet4.Cells(TotRow, 10).Formula = "=" & Sheet4.Cells(TotRow, 8).Value * Sheet4.Cells(TotRow, 3) / 100)
I am getting as =Figure and not as =H5*H3/100 in the cell
Thanks
NimishK

### Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

#### Michael M

##### Well-known Member
Untested, but I thiunk you need

"
Code:
``=Sheet4!H" & TotRow & "*Sheet4!H" & TotRow & " / 100)"``

but that doesn't equate to H5*H3/100....I'm guessing you will be able to mdify as required

#### Michael M

##### Well-known Member
ooops, sorry
Code:
``.Formula = "=Sheet4!H" & totrow & "*Sheet4!H" & totrow & " / 100"``

#### NimishK

##### Well-known Member
will let you know after testing

#### NimishK

##### Well-known Member
Sorry Michael It did not work. Hope you had tried too

By the way if i defined

wS as Worksheet then how would the syntax be for Following
Dim wS as Worksheet
Set wS = Sheets("Sheet4")
ws.Cells(TotRow, 10).Formula = "=" & ws.Cells(TotRow, 8).Value * ws.Cells(TotRow, 3) / 100)

Last edited:

#### Rick Rothstein

##### MrExcel MVP
By the way if i defined

wS as Worksheet then how would the syntax be for Following
Code:
``````Dim wS as Worksheet
Set wS = Sheets("Sheet4")
ws.Cells(TotRow, 10).Formula = "=" & ws.Cells(TotRow, 8).Value * ws.Cells(TotRow, 3) / 100)``````
Try it like this...
Code:
``````[table="width: 500"]
[tr]
[td]  Dim wS As Worksheet
Dim TotRow As Long
Set wS = Sheets("Sheet4")
TotRow = 9
wS.Cells(TotRow, 10).Formula = "=" & wS.Cells(TotRow, 8).Address(0, 0) & "*" & wS.Cells(TotRow, 3).Address(0, 0) & "/100"[/td]
[/tr]
[/table]``````

#### NimishK

##### Well-known Member
Thank you so much Rick. just perfect

Replies
1
Views
123
Replies
5
Views
146
Replies
5
Views
229
Replies
4
Views
101
Replies
6
Views
75

1,186,877
Messages
5,960,372
Members
438,472
Latest member
Nate J

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back