Search code examples
excelexcel-formulaspreadsheet

Excel if one cell is filled place value in another cell


Noob question. I've tried several options from SO and elsewhere but I'm sure I'm missing something.

I have the following table: enter image description here

I want to make a formula that does the following:

If the user puts any text in cell 1 = put a 5 in the final cell.

If the user puts any text in cell 2 = put a 4 in the final cell.

If the user puts any text in cell 3 = put a 3 in the final cell.

If the user puts any text in cell 4 = put a 2 in the final cell.

If the user puts any text in cell 5 = put a 1 in the final cell.

Any help is appreciated.


Solution

  • If one cell only is filled you can use this formula:

    =IFERROR(6-MATCH(FALSE,ISBLANK(A1:E1),0),0)
    

    If more than one cell is filled this formula will take the first filled cell.