Excel formula

New Contributor

I am a total beginner with Excel.  I think this is a very simple function but I am not getting it.  I am trying to write a formula that if there is an X in one column then it has one value if not then nothing and if the next column has an X in it then it has another value with the next column with the amount.

2 Replies
best response confirmed by Hans Vogelaar (MVP)
So the first concept to understand in Excel is that the formulas will display their result in that cell and that is it (i.e. they can not change or modify or move other cells or formats). So you are right on track. In the cell where you want the resulting value you type something like:
=IF(a1="X" , 1 , "")
This means IF the value in cell a1 is "X" then show me 1 and if NOT then show me blank
next/alternatively you can return the value from a different cell:
=IF(a1="X", b1, "")
In this case if cell a1 is X then it will return the value found in cell b1 (otherwise show blank)
And you can start to 'stack' these formulas:
=IF(a1="X", 1 , IF(b1="X", c1, "") )
Now it is getting a little more complicated but take it 1 step at a time. IF the value in a1 is X then show me 1 but if not then do the next IF statement and check if the value in b1 is X and if so then show me the value from c1 and if not (i.e. neither a1 nor b1 have X) then show blank.
I hope this helps you understand how to do it or maybe at least how you might explain what you need a little more.

@mtarler Thank you for your help and explanation.