Jun 30 2023 10:12 AM
Hello formula friends,
I have a column (let's say column B) that I would like to create a formula for. The gist is:
- if column A has a value, then column B should be empty.
- if column A does NOT have a value, then column B should keep the value it currently has.
Any thoughts on how I can accomplish this?
Jun 30 2023 10:49 AM
Let me clarify something if you need to take actian based on data in colunm A or B you need a new colunm to do it, let's suppose C. If you do it in this way, yo can inlcude following formula en column C.
IF (A2<>"", "", B2).
If you like to keep just columns A and B you can "hide" values in column B with conditional formatting settting font color like a backgroud color. You can use following condition in conditional formatting =$A4<>""
I'm not sure if I got your point. If not please share an example.
Regards
Jun 30 2023 12:49 PM - edited Jun 30 2023 12:52 PM
Hi Leo,
Thank you for your help. For our purposes let's pretend B2's value is currently "purple".
If A2 is not blank, then populate B2 from A2.
If A2 is blank, then keep "purple".
Jun 30 2023 02:20 PM
Jul 01 2023 04:40 AM - edited Jul 01 2023 07:06 AM
Hi @LauraJackson, what you want is impossible using just formulas, if you need to keep just two columns. This is Because you can not have a previous value and a formula in the same cell. At least to my best knowledge, you have these options:
1-Add a column C which has logic and expected results
A | B | C |
Yellow | Purple | Yellow |
White | Green | White |
Purple | Purple |
2- Make it through VBA code, it is possible using the event change of the worksheet. But I'm not sure if you like to use code.
Let me know if the second option works for you and I'll tell you the code.
Regards
Jul 05 2023 09:52 AM - edited Jul 05 2023 09:55 AM
Hi Leo,
Option 1 is perfect! I had not thought about it that way. Any thoughts on how I could create this formula in a column C?
- if column A has a value, then column C should be empty.
- if column A does NOT have a value, then column C should populate from column B.
Jul 05 2023 12:40 PM
Solution