Search code examples
excelif-statementexcel-formulaworksheet-function

Combining data from columns with a conditon


I have two columns, column O and column P, along with a new blank column Q. I want column Q to be filled with values from column P, unless the cell is blank, in which case I'd like that cell to be filled with the value from column O.

I'm trying to come up with an if/else conditional but I don't have a great grasp on Excel syntax. Pseudocode:

if(P1 != "") {
   P1
} else { 
   O1
}

Solution

  • Please try:

    =IF(P1="",O1,P1)  
    

    copied down to suit.