Use the IF function to compare columns and return a result
In this example, we will be using the IF function to compare columns and return a specific result instead of the standard TRUE or FALSE. We will have values in column A and B and we will compare them to see if if Column A is greater than or equal to Column B or if Column B is greater than A. Here is how we’ll achieve this. We will return the results of the formula in Column C.
How to compare columns and return a custom result
- Enter your values in Column A and B from row 1 - 10.
- Select Cell C1 and enter the following formula: =IF(A1>=B1,”Column A is greater or equal”,”Column
B is greater”). - Press Enter. Use the fill handle to copy the formula to row 10.
Your custom result will be returned in the adjacent Column C if Column A or Column B has the larger value. This tip should work in Excel 97, 2000, 2003 and 2007. Apply and modify for use in your own worksheets. Thanks.