Google sheets: swap column value if present

1.4k Views Asked by At

How can I write a formula in Google sheets to swap a value between Column 1 and Column 2 only if there's a value in Column 2?

    1    |    2
-------------------
    V    |
    S    |    T    

I want the second row to swap, not the first. Any help?

1

There are 1 best solutions below

0
On BEST ANSWER

Turns out it's pretty easy. Here's the formula for the first column:

=if(B2, B2, A2)