Got stuck in writing the syntax for IF formula

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
684
Hello
=IF(BE3<$A$1,BF3,0)+IF(BJ3<$A$1,BK3,0)+IF(BO3<$B$2,BP3,0)+IF(BT3<$A$1,BU3,0)+IF(BY3<$A$1,BZ3,0)
Got stuck in writing the syntax for above with IF formula
Code:
curRow = 3
ws.Cells(curRow, 83).Formula = "=IF(BE" & curRow & "<a1," &="" "bf,"="" "0)"
Thanks
NimishK</a1,">
 
Last edited:

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.
Recording a macro of me entering the formula into a cell is the way that I get proper syntax for that formula.
 
Upvote 0
Thank you sir, For the Hint
Had to struggle a bit because of commas or seperators.
So far so good
<a1" &="" ",bf"="" currow="" ",0)"="" _
<a1" &="" ",bk"="" currow="" ",0)"="" _
<a1" &="" ",bp"="" currow="" ",0)"="" _
<a1" &="" ",bu"="" currow="" ",0)"="" _
<a1" &="" ",bz"="" currow="" ",0)"
<a1" &="" ",bf"="" currow="" ",0)"="" _
<a1" &="" ",bk"="" currow="" ",0)"="" _
<a1" &="" ",bp"="" currow="" ",0)"="" _
<a1" &="" ",bu"="" currow="" ",0)"="" _
<a1" &="" ",bz"="" currow="" ",0)"
<a1" &="" ",bf"="" currow="" ",0)"="" "+if(bj"="" "<a1"="" ",bk"="" "+if(bo"="" ",bp"="" "+if(bt"="" ",bu"="" "+if(by"="" ",bz"="" ",0)"
<a1" &="" ",bf"="" currow="" ",0)"="" "+if(bj"="" "<a1"="" ",bk"=""
<a1" &="" ",bf"="" currow="" ",0)"="" "+if(bj"="" "<a1"="" ",bk"="" ",0)"
<a1" &="" ",bf"="" currow="" ",0)"=""
Code:
ws.Cells(curRow, 83).Formula = "=IF(BE" & curRow & "<A1" & ",BF" & curRow & ",0)"<a1" &="" ",bf"="" currow="" ",0)"
Except for the Abosolute refernce before A1 i.e "<$A$1"</a1"></a1"></a1"></a1"></a1"></a1"></a1"></a1"></a1"></a1"></a1"></a1"></a1"></a1"></a1">
 
Last edited:
Upvote 0
ws.Cells(curRow, 83).Formula = "=IF(BE" & curRow & "<a1" &="" ",bf"="" currow="" ",0)"<a1"="" ",0)"
cant submit the full code som errors came when copying the code
ws.Cells(curRow, 83).Formula = "=IF(BE" & curRow & "<A1" & ",BF" & curRow & ",0)"____________</a1">
 
Last edited:
Upvote 0
@NimishK
You need to add spaces around the < & > signs, otherwise the software thinks that you are posting HTML code.
 
Upvote 0
Try this.
Code:
Cells(curRow, 83).FormulaR1C1 = "=IF(R1C1>RC[-26],RC[-25],0)+IF(R1C1>RC[-21],RC[-20],0)+IF(R2C2>RC[-16],RC[-15],0)+IF(R1C1>RC[-11],RC[-10],0)+IF(R1C1>RC[-6],RC[-5],0)"
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,576
Members
448,972
Latest member
Shantanu2024

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top