Quantcast
Channel: Active questions tagged worksheet-function - Super User
Viewing all articles
Browse latest Browse all 1009

How to compare two columns in Excel with a conditional IF statement?

$
0
0

I have three columns that have some expense figures: Actual (column A), Budget (column B), Variance (column C):

For these expenses, if Actual is greater than Budget, I want the variance column result/formula to be Budget minus Actual. But if Actual is less that Budget, I want the variance column result/formula to be Actual minus Budget.

I have tried the following, but this is a new field for me so I would really appreciate your assistance. This is what I have tried, but it doesn’t work as expected:

=IF(G5>H5,G5-H5,H5-G5)

What is the Excel formula/syntax for this?


Viewing all articles
Browse latest Browse all 1009

Trending Articles