Forum Discussion
smoiz
Dec 15, 2022Copper Contributor
Set function In excel
I have a column with flags (1,0) and in another column I'm looking to set the value to say 1000 after 'n' number of row of flag occurrence. I have this =IF(F9=1,INDIRECT("H"&A9+n)="1000",0), I kn...
PeterBartholomew1
Dec 15, 2022Silver Contributor
Excel can be regarded as an implementation of the Functional Programming paradigm and, as such, does not allow variables (here cell values) to be set other than by the code that defines them. Even UDFs written in VBA (an imperative programming language) are blocked from having such 'side effects'.
Your choices would appear to be
1. writing code in VBA that reads from the worksheet but does not use the functionality of the worksheet or
2. writing worksheet formulas in the 'other' column to read the flags and determine whether a value (1000) is to be displayed or not in the formula cell.