1

I have an array of cells that contain all numerators (A2:A500) and an array of cells that contain all denominators (B2:B500) think of them as a fraction.

Is there a way to put them to the smallest common fraction and sum them up in one line? I can do it with the use of another column with multiplied numerators but I struggle to make it a one liner. How can something like this be achieved ?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Lukas Anda
  • 716
  • 1
  • 9
  • 30

3 Answers3

0

An example for three cells:

=SUMPRODUCT(A1:A3/B1:B3)

enter image description here

Gary's Student
  • 95,722
  • 10
  • 59
  • 99
0

You will get easily an overflow if the LCM of column B is too high. Anyway, this formula will get you the numerator of the sum fraction:

=SUMPRODUCT(A2:A500/B2:B500)*LCM(B2:B500)

Obviously the denominator is =LCM(B2:B500)

p.s.: I assumed you wanted to have a Fraction as a result. If you want just the resulting number, Garry's answer is the straightforward way to go.

A.S.H
  • 29,101
  • 5
  • 23
  • 50
0

And you may calculate the GCD(numerator,denominator) to obtain the reduced fraction.