# Runtime Error 1004

#### angel_03

##### New Member
hi,

i have programmed the formula below formula for my reports..however i get an error msg which says

"Runtime Error 1004: Application or object defined error"

Range("L276").formula = "=IF(H276<M276,((H276*\$J\$3)+(M276*(12-\$J\$3)))/12,((H276*\$J\$3)+(H276*(12-\$J\$3)))/12"

i have also defined my worksheet that should be called...

what could be my mistake?

### Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

#### Richard Schollar

##### MrExcel MVP
Hi

By the looks of it, your formula has been truncated - quite possibly because you used a < sign in the message (these get interpreted as html unless you use a space after them eg:

"=IF(H37< A38,1,0)"

#### angel_03

##### New Member
Hi

By the looks of it, your formula has been truncated - quite possibly because you used a < sign in the message (these get interpreted as html unless you use a space after them eg:

"=IF(H37< A38,1,0)"
"=IF(H530 < M530,((H530*\$J\$3)+(M530*(12-J3)))/12,((H530*\$J\$3)+
(H530*(12-J3)))/12"

i have tried that too...but i have another formula which contains a similar statement in my codes, however only this gives out an error msg...

have tried changing the signs but it gives mt the same error

#### Richard Schollar

##### MrExcel MVP
You look like you might be missing a ) off of the end:

"=IF(H530 < M530,((H530*\$J\$3)+(M530*(12-J3)))/12,((H530*\$J\$3)+
(H530*(12-J3)))/12)"

Replies
8
Views
2K
Replies
3
Views
227
Replies
13
Views
291
Replies
3
Views
146
Replies
0
Views
258

1,191,177
Messages
5,985,140
Members
439,942
Latest member
bkexcel11230

### 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