Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default sorting ranges with open ends

I have a number of values ranging from positive to negative that I need to
sort into 5 categories depending on different ranges (i.e the number 3 and 5
are "1-10" and so on)
ex. of values:
1, 15, 0, -15, -32, -100

the positive are openended (i.e they range from 1 and up)
0 is included in the positive numbers.
the negative range from -1 to <-91. (i.e it ranges from -91 and down)

I need these to be sorted into categories and labeled in a separate column
like this:
range: label
0 ; "0"

-1<-30 ; "'1-30"
-31<-60 ; "'31-60"
-61<-90 ; "'61-90"
<-91 "'91"


I have tried to do this with VLOOKUP but I am unsure of how to do this with
open ends (i.e <-91 and 0)
there might be some way to do this with the IF function (or a combination of
other logical functions)

any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default sorting ranges with open ends

You may have to fiddle with this a bit, but any of these techniques should
give you what you want:

=IF(A2="","",SUM($A$2:A2)-A2+1&IF(A2=1,""," - "&SUM($A$2:A2)))

=IF(OR(A2="",A2=0),"",SUM($A$2:A2)-A2+1&IF(A2=1,""," - "&SUM($A$2:A2)))

=Frequency()
From Help: Calculates how often values occur within a range of values, and
then returns a vertical array of numbers.


Regards,
Ryan---


--
RyGuy


"spreadsheet monkey" wrote:

I have a number of values ranging from positive to negative that I need to
sort into 5 categories depending on different ranges (i.e the number 3 and 5
are "1-10" and so on)
ex. of values:
1, 15, 0, -15, -32, -100

the positive are openended (i.e they range from 1 and up)
0 is included in the positive numbers.
the negative range from -1 to <-91. (i.e it ranges from -91 and down)

I need these to be sorted into categories and labeled in a separate column
like this:
range: label
0 ; "0"

-1<-30 ; "'1-30"
-31<-60 ; "'31-60"
-61<-90 ; "'61-90"
<-91 "'91"


I have tried to do this with VLOOKUP but I am unsure of how to do this with
open ends (i.e <-91 and 0)
there might be some way to do this with the IF function (or a combination of
other logical functions)

any ideas?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default sorting ranges with open ends

Indeed you can do with VLOOKUP. Set up your table as follows:

-9.99E307 90
-90 61-90
-60 31-60
-30 1-30
0 0

If this table is in A1:B5 you can use:

=VLOOKUP(val,A1:B5,2,TRUE)

HTH
Kostis Vezerides

On Oct 17, 5:10 pm, spreadsheet monkey
wrote:
I have a number of values ranging from positive to negative that I need to
sort into 5 categories depending on different ranges (i.e the number 3 and 5
are "1-10" and so on)
ex. of values:
1, 15, 0, -15, -32, -100

the positive are openended (i.e they range from 1 and up)
0 is included in the positive numbers.
the negative range from -1 to <-91. (i.e it ranges from -91 and down)

I need these to be sorted into categories and labeled in a separate column
like this:
range: label0 ; "0"

-1<-30 ; "'1-30"
-31<-60 ; "'31-60"
-61<-90 ; "'61-90"
<-91 "'91"

I have tried to do this with VLOOKUP but I am unsure of how to do this with
open ends (i.e <-91 and 0)
there might be some way to do this with the IF function (or a combination of
other logical functions)

any ideas?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
filter using "ends with" and 3 choices? Ex: ends with 1,2 or3 Debbie Excel Worksheet Functions 1 April 6th 07 12:07 AM
Sorting Ranges of Data Kevin Dunn Excel Worksheet Functions 2 October 16th 06 09:06 PM
sorting non contiguous ranges gsh20 Excel Discussion (Misc queries) 1 September 8th 05 04:50 PM
Sorting Multiple Ranges simoneaux Excel Worksheet Functions 1 February 8th 05 03:11 PM
Sorting ranges candybox Excel Worksheet Functions 6 December 29th 04 11:24 PM


All times are GMT +1. The time now is 06:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"