# Replacing contents of one cell with that of another in the same row

Hello!

Is there a way, via a formula, to replace the contents of one cell with the contents of another cell in the same row, only if the second cell is not blank?

I have a credit column (CC) and a partial credit column (PCC). If there's an entry in PCC, I want that value to replace the value in CC.

Thanks!

• ✭✭✭✭✭

Hi @Sandra Bauman ! You should be able to couple the IF function with NOTBLANK to accomplish this, but you may need a third column (Ex: Credit column, partial credit column, final credit column)

Your CC and PCC would stay the same. Here's the formula you can use for your "Final" Credit Column:

=IF(NOTBLANK([PCC]@row), [PCC]@row, [CC]@row)

• ✭✭✭✭✭

Hi @Sandra Bauman ! You should be able to couple the IF function with NOTBLANK to accomplish this, but you may need a third column (Ex: Credit column, partial credit column, final credit column)

Your CC and PCC would stay the same. Here's the formula you can use for your "Final" Credit Column:

=IF(NOTBLANK([PCC]@row), [PCC]@row, [CC]@row)

• Amber, thank you for your answer! Unfortunately, I don't seem to have the NOTBLANK function.

During my waiting time for an answer, I figured a solution out:

=IF([Partial Credit]@row > 0, INDEX([Partial Credit]@row, MATCH([Partial Credit]@row, [Partial Credit]@row, 0)), Credit@row))

=IF(NOT(ISBLANK([Partial Credit]@row)), [Partial Credit]@row, [Credit]@row)

I sure do appreciate the Smartsheet community!!!!

• ✭✭✭✭✭

@Sandra Bauman I'm so glad you were able to work on an answer! Yes this community is awesome :)

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!