SOLVED

Excel formula

Copper Contributor

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?

7 Replies

Hi @LauraJackson 

 

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

My upwork profile 

 

 

 

 

 

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".

column A does NOT have a value, then column B should keep the value it currently has.

Could you please share a file with somedata and show your expected result?
I am confused about the meaning about the above words.

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

ABC
YellowPurpleYellow
WhiteGreenWhite
 PurplePurple

 

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

My UPWORK Profile  

 

 

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.

 

best response confirmed by LauraJackson (Copper Contributor)
Solution

Hi @LauraJackson  This formula should works=IF(A2<>"";"";B2).

 

Regards

My Upwork Profile 

That worked perfectly. Thank you very much Leo!
1 best response

Accepted Solutions
best response confirmed by LauraJackson (Copper Contributor)
Solution

Hi @LauraJackson  This formula should works=IF(A2<>"";"";B2).

 

Regards

My Upwork Profile 

View solution in original post