ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Help creating Formula (or macro) (https://www.excelbanter.com/excel-discussion-misc-queries/82316-help-creating-formula-macro.html)

bman342

Help creating Formula (or macro)
 
I have a range of five numbers, say A1:A5.
I want to identify the three lowest numbers in that range,
and then return the sum of those three numbers.
Was trying to use sumif, but could not figure it out.

I then set up a simple (follow me) macro which copied the range, pasted the
values,
then sorted, and then I just added the bottom three cells. That works fine,
except I have 30 such ranges, and cannot now figure out how to step the macro
to the next range (it keeps returning to the original range), hence why I am
trying to do this through a formula.

Any help would be appreciated.

-b

Biff

Help creating Formula (or macro)
 
Hi!

Try this:

=SUM(SMALL(A1:A5,{1,2,3}))

Biff

"bman342" wrote in message
...
I have a range of five numbers, say A1:A5.
I want to identify the three lowest numbers in that range,
and then return the sum of those three numbers.
Was trying to use sumif, but could not figure it out.

I then set up a simple (follow me) macro which copied the range, pasted
the
values,
then sorted, and then I just added the bottom three cells. That works
fine,
except I have 30 such ranges, and cannot now figure out how to step the
macro
to the next range (it keeps returning to the original range), hence why I
am
trying to do this through a formula.

Any help would be appreciated.

-b




bman342

Help creating Formula (or macro)
 
Biff:

Works like a charm, thanks so much.

-b

"Biff" wrote:

Hi!

Try this:

=SUM(SMALL(A1:A5,{1,2,3}))

Biff

"bman342" wrote in message
...
I have a range of five numbers, say A1:A5.
I want to identify the three lowest numbers in that range,
and then return the sum of those three numbers.
Was trying to use sumif, but could not figure it out.

I then set up a simple (follow me) macro which copied the range, pasted
the
values,
then sorted, and then I just added the bottom three cells. That works
fine,
except I have 30 such ranges, and cannot now figure out how to step the
macro
to the next range (it keeps returning to the original range), hence why I
am
trying to do this through a formula.

Any help would be appreciated.

-b





Biff

Help creating Formula (or macro)
 
You're welcome. Thanks for the feedback!

Biff

"bman342" wrote in message
...
Biff:

Works like a charm, thanks so much.

-b

"Biff" wrote:

Hi!

Try this:

=SUM(SMALL(A1:A5,{1,2,3}))

Biff

"bman342" wrote in message
...
I have a range of five numbers, say A1:A5.
I want to identify the three lowest numbers in that range,
and then return the sum of those three numbers.
Was trying to use sumif, but could not figure it out.

I then set up a simple (follow me) macro which copied the range, pasted
the
values,
then sorted, and then I just added the bottom three cells. That works
fine,
except I have 30 such ranges, and cannot now figure out how to step the
macro
to the next range (it keeps returning to the original range), hence why
I
am
trying to do this through a formula.

Any help would be appreciated.

-b








All times are GMT +1. The time now is 10:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com