BornKillaz
BornKillaz

Reputation: 602

Find the higher number between two cells and divide by two

In Excel, I have two cells side by side and I know the cell on the right (D4) has a higher value than the cell on the left (C4).

So I subtract cell on the right (D4) by the cell on the left (C4). And I need to divide the result by 2, so I use:

=(D4-C4)/2

However, sometimes, it can happen that the cell C4 is higher than the D4, and I have no idea of what formula to use to first find witch cell should I divide by the other.

I tried like this:

=(MAX(C4;D4) - MIN(C4;D4)) / 2

However this does not work.

Upvotes: 0

Views: 58

Answers (1)

Gary's Student
Gary's Student

Reputation: 96753

Consider:

=ABS(D4-C4)/2

enter image description here

You don't need to know which value is greater.

Upvotes: 4

Related Questions