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)))

25/20
20/20
19/20
19/20

<colgroup><col></colgroup><tbody>
</tbody>
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

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
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
125/2060
225/20
310/20
410/20

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
</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,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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