Search code examples
excelexcel-formulaexcel-2010

How to compare 2 integers in terms of how many times 1st Integer is greater than second


I am looking to find a formula in excel by which I can calculate how many times 1st integer is greater than second.

For Example:

A = 5
B = 1
Ans: (A/B) i.e 5/1 = 5
A is 5 times bigger than B. Simple Enough!!

Problem occurs when one integer is negative, Example:

A = 10
B = -5

How do I calculate in excel, how much time A is bigger or smaller than B.

Condition: Any Integer could be negative (A or B)

Thank You!!

What I tried:

A = 10
B = -5
C = A / B 
C = 10 / -5 
C = -2 which is incorrect :(**

Solution

  • Maybe try:

    enter image description here

    Formula in A4:

    =(MAX(A1:A2)-MIN(A1:A2))/MIN(ABS(A1:A2))+(OR(MIN(A1:A2)>0,MAX(A1:A2)<0))