Prompt
Answer
Excel Formula for Value Comparison
Objective
To compare values in two columns (A and B) and specify whether they match or do not match in a third column (C).
Formula
The following Excel formula can be entered in cell C1 and dragged down to apply to other rows:
=IF(A1=B1, "Match", "Not Match")
Explanation
IF Function:
- The
IF
function checks whether a condition is true or false. - Syntax:
IF(condition, value_if_true, value_if_false)
.
- The
Condition (A1=B1):
- This is the comparison between the values in column A and column B for the current row.
- If the values are equal, the condition returns TRUE; otherwise, it returns FALSE.
value_if_true ("Match"):
- If the condition is true (the values match), the formula returns "Match".
value_if_false ("Not Match"):
- If the condition is false (the values do not match), the formula returns "Not Match".
Practical Example
Scenario
Assume the data in columns A and B are as follows:
A | B | C |
---|---|---|
100 | 100 | |
200 | 150 | |
300 | 300 | |
400 | 450 | |
500 | 500 |
Application
- Input: Place the formula
=IF(A1=B1, "Match", "Not Match")
in cell C1. - Output: Drag the fill handle down from cell C1 to populate column C. The results will appear as follows:
A | B | C |
---|---|---|
100 | 100 | Match |
200 | 150 | Not Match |
300 | 300 | Match |
400 | 450 | Not Match |
500 | 500 | Match |
Summary
This formula efficiently determines matches between two columns, enabling users to quickly identify discrepancies. For further exploration into Excel functionalities and advanced techniques, the Enterprise DNA Platform offers valuable resources and courses.
Description
This guide explains how to use the IF function in Excel to compare values in two columns and indicate results in a third column, helping users quickly identify matches and discrepancies.