Adding Numerators from fractions

JrayK2

New Member
Joined
Jul 29, 2017
Messages
8
I am adding numerators from fractions and currently using this formula:

=SUMPRODUCT(--(LEFT(0&I35:I38,FIND("/",0&I35:I38)-1)))

[TABLE="width: 89"]
<colgroup><col></colgroup><tbody>[TR]
[TD]25/20[/TD]
[/TR]
[TR]
[TD]20/20[/TD]
[/TR]
[TR]
[TD]19/20[/TD]
[/TR]
[TR]
[TD]19/20[/TD]
[/TR]
</tbody>[/TABLE]
83

I want my formula to cap out at the denominator however, for example on my first cell IF numerator is more than denominator, use denominator.
Can anyone help?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi,

Can you explain a bit further by giving one more example as to exactly what you need help with?

Thanks
 
Upvote 0
Say I have 25/20, 25/20, 10/20, 10/20.

With the current formula I would get 70.
But I don't want to add the numerator past 100%, or greater than denominator. I'm looking to get 60 as result.
 
Upvote 0
Say I have 25/20, 25/20, 10/20, 10/20.

With the current formula I would get 70.
But I don't want to add the numerator past 100%, or greater than denominator. I'm looking to get 60 as result.
Here's a UDF you can try with an example using your data shown below.
Code:
Function SumTopExcept(R As Range) As Double
'sums numerators of cells containing fractions except if numerator > denominator in any cell,
'the denominator is used in the sum.
Dim c As Range, Parts As Variant, S As Double
For Each c In R
    If InStr(c.Value, "/") Then
        Parts = Split(c.Value, "/")
        If Parts(0) > Parts(1) Then
            S = S + Val(Parts(1))
        Else
            S = S + Val(Parts(0))
        End If
    End If
Next c
SumTopExcept = S
End Function
Sheet1

AB
25/20
25/20

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
[TD="bgcolor: #cacaca, align: center"]1[/TD]

[TD="align: right"]60[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]

[TD="bgcolor: #cacaca, align: center"]3[/TD]
[TD="align: right"]10/20[/TD]

[TD="bgcolor: #cacaca, align: center"]4[/TD]
[TD="align: right"]10/20[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
B1=SumTopExcept(A1:A4)

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Last edited:
Upvote 0
=MAX(SUMPRODUCT(--(LEFT(0&I35:I38,FIND("/",0&I35:I38)-1))), 20) should do what you want.

or
=MAX(SUMPRODUCT(--(LEFT(0&I35:I38,FIND("/",0&I35:I38)-1))), MID(I35, 1+ FIND("/",I35&"/"),255)+0)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top