![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Mike
Posts: 796
|
Jay,
Can I use coding like the following (an "IF Stmnt")? .Range("M2:M" & lastrow) = "=IF(RC[-2]<0,RC[]*-1,RC[])" Where RC[] is the current cell in Col "M". Or is the current cell labeled as RC? I get a failure notice (Debug) when I use the "IF". Thanks, Zac |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
Quote:
Not quite sure what you are trying to do. This syntax won't work, and the other syntax you tried probably won't work either unless you enable iterations Tools>Options>check Iteration You are creating a circular reference here. I try to avoid these if I can, and do any iterative techniques through Goal Seek, Solver or VBA. NateO posted a workaround for you, where the data is changed to suit your requirements. If you require a worksheet formula, try to adjust a dependent formula if you do not want intentional circular references. For instance, if K<0, you want the negative M value, so K*M is positive, right? In your calculated cell, use something like =ABS(K*M) and see if that gives you what you need. HTH, Jay |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|