Forum Discussion
=IF formula to fill a referenced cell
- Aug 09, 2024
so no you can NOT set the value or display setting of a different cell using a cell formula
you could use a macro/VBA but even that might get tricky/buggy
one option you could do is use custom formatting and define '0' to be "name" and then preset the value of those cells to be 0 (zero). In this way any formula could easily ignore anything = 0 but the user would SEE the text prompt
so to do this select cell B3 and go Home-> Number ->custom formatting->Custom -> and in the box type something like: 0.00;-0.00;"Name"This is summarized in the following picture:
notice how cell H29 is selected and is SHOWING "Name" but in the formula bar the actual value in the cell is 0. And the Format window is open showing that cell has custom formatting selected and in the "Type" entry I entered: 0.00; -0.00; "Name"
so no you can NOT set the value or display setting of a different cell using a cell formula
you could use a macro/VBA but even that might get tricky/buggy
one option you could do is use custom formatting and define '0' to be "name" and then preset the value of those cells to be 0 (zero). In this way any formula could easily ignore anything = 0 but the user would SEE the text prompt
so to do this select cell B3 and go Home-> Number ->custom formatting->Custom -> and in the box type something like: 0.00;-0.00;"Name"
This is summarized in the following picture:
notice how cell H29 is selected and is SHOWING "Name" but in the formula bar the actual value in the cell is 0. And the Format window is open showing that cell has custom formatting selected and in the "Type" entry I entered: 0.00; -0.00; "Name"
- acass2024Aug 09, 2024Copper Contributor
Thank you! The custom format idea is very clever.
Since you mentioned VBA, I figured I'd give it a shot and see if anyone else has tackled this problem. I found this solution which is working wonderfully! I altered the code to reference a single cell and fill with "Name".