Forum Discussion
Excel formula
- Jul 05, 2023
Hi LauraJackson This formula should works=IF(A2<>"";"";B2).
Regards
https://www.upwork.com/freelancers/~01cf0fc8446b00f44c
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".
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
https://www.upwork.com/freelancers/~01cf0fc8446b00f44c
- LauraJacksonJul 05, 2023Copper Contributor
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.
- leoperdiaJul 05, 2023Brass Contributor
Hi LauraJackson This formula should works=IF(A2<>"";"";B2).
Regards
https://www.upwork.com/freelancers/~01cf0fc8446b00f44c
- LauraJacksonJul 05, 2023Copper ContributorThat worked perfectly. Thank you very much Leo!