Excel Formula Help - IF Formulas
IF formulas are some of the most commonly used in Microsoft Excel. IF statements act like questions with true of false answers in a nested format.
Before we look closer at a formula, let's size up this typical invoice list. As we can see, there are gaps between the companies making it easier to read.
This is great for humans but causes problems if we want to work with the data in Excel. So, we need to fill in the space with the relevant company names.
We do this first by selecting the the cell to the left of the first company, in this case A2. In this cell, we simply write =B2 and press return to get a copy of the company name. We then move one cell bellow to A3 and enter the statement =IF(B3="",A2,B3)
Narratively speaking, what we are saying is that if this cell, B3, is empty, then enter the contents of the above cell - the company name. If it is not empty, leave it as it is. Then hit Return.
As the cell was in fact empty, the formula now fills the cell with the data from above. We can then copy down A3 a to get the rest of the company names.
All we need do then is select the full list we have just generated and copy it over, as seen in the diagram below. Use Paste Special and Values (V) to overwrite the original column:
Delete the contents for column A and we are finished:
For more or how to use IF and other common Excel functions, get in touch with our experts or check the Microsoft Excel help pages.