Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-07-2008, 01:18 PM
dave.mcmanus@gmail.com
 
Posts: n/a
Limitations of Quartile Function

Hi,

I'm trying to reference a dataset in a Quartile formula that is spread
over 2 worksheets, i.e. I have a column of numbers on 2 different
sheets that I want to be evaluated by the same quartile function, but
it's not having it. If it were a Min/Max/Median function I was using
it would have no problem but Quartile only seems to provide an answer
for multiple ranges if the ranges exist on the same spreadsheet.

I can't move my data as this is impractical. Does anyone know of a
solution to this problem?

Thanks,

Dave.
Reply With Quote
  #2 (permalink)  
Old 07-07-2008, 03:58 PM
Bernie Deitrick
 
Posts: n/a
Re: Limitations of Quartile Function

Dave,

> I can't move my data as this is impractical.


Why can't you? Copy and paste is easy....

Bernie
MS Excel MVP


<dave.mcmanus@gmail.com> wrote in message
news:4d4798ed-5450-4e9a-bec3-07dddddad1f4@m45g2000hsb.googlegroups.com...
> Hi,
>
> I'm trying to reference a dataset in a Quartile formula that is spread
> over 2 worksheets, i.e. I have a column of numbers on 2 different
> sheets that I want to be evaluated by the same quartile function, but
> it's not having it. If it were a Min/Max/Median function I was using
> it would have no problem but Quartile only seems to provide an answer
> for multiple ranges if the ranges exist on the same spreadsheet.
>
> I can't move my data as this is impractical. Does anyone know of a
> solution to this problem?
>
> Thanks,
>
> Dave.



Reply With Quote
  #3 (permalink)  
Old 07-07-2008, 05:07 PM
dave.mcmanus@gmail.com
 
Posts: n/a
Re: Limitations of Quartile Function



Bernie,

unfortunately the data has to stay where it is as there are a whole
series of reports and macros already linked to it and the document is
a key source of information for several users, I can't go moving
things around in it. One worksheet contains monthly commodity prices,
the other contains quarterly commodity prices, they need to stay
separate from each other for ease of interpretation. Also these
sheets are updated daily so I can't just copy the data into another
workbook for the purposes of mashing it together because then I'd have
to update the mashup every day as well (I try to avoid creating
unneccessary work for myself wherever possible!).

So any ideas about how Quartile can use ranges from more than one
worksheet at a time?

Thanks.

Dave.



Reply With Quote
  #4 (permalink)  
Old 07-07-2008, 05:58 PM
Bernd P
 
Posts: n/a
Re: Limitations of Quartile Function

Hello,

Use PERCENTILE with a named range ...

Regards,
Bernd
Reply With Quote
  #5 (permalink)  
Old 07-07-2008, 06:12 PM
Bernie Deitrick
 
Posts: n/a
Re: Limitations of Quartile Function

Dave,

One way would be to roll your own, with a User-Defined-Function: copy the code below into a regular
module and use it like

=MYQUARTILE(B2:B100,Sheet2!B2:B100,1)

HTH,
Bernie
MS Excel MVP


Function myQuartile(R1 As Range, R2 As Range, Q As Integer)
Dim myArr() As Double
Dim i As Integer
Dim j As Integer
Dim k As Integer

i = R1.Cells.Count
j = R2.Cells.Count

ReDim myArr(1 To i + j)

For k = 1 To i
myArr(k) = R1.Cells(k).Value
Next k

For k = 1 To j
myArr(i + k) = R2.Cells(k).Value
Next k

myQuartile = Application.WorksheetFunction.Quartile(myArr, Q)
End Function




<dave.mcmanus@gmail.com> wrote in message
news:47fffde8-f7ef-41c0-9b44-7aec4deb44c5@k37g2000hsf.googlegroups.com...
>
>
> Bernie,
>
> unfortunately the data has to stay where it is as there are a whole
> series of reports and macros already linked to it and the document is
> a key source of information for several users, I can't go moving
> things around in it. One worksheet contains monthly commodity prices,
> the other contains quarterly commodity prices, they need to stay
> separate from each other for ease of interpretation. Also these
> sheets are updated daily so I can't just copy the data into another
> workbook for the purposes of mashing it together because then I'd have
> to update the mashup every day as well (I try to avoid creating
> unneccessary work for myself wherever possible!).
>
> So any ideas about how Quartile can use ranges from more than one
> worksheet at a time?
>
> Thanks.
>
> Dave.
>
>
>



Reply With Quote
  #6 (permalink)  
Old 07-08-2008, 10:21 AM
dave.mcmanus@gmail.com
 
Posts: n/a
Re: Limitations of Quartile Function

On 7 Jul, 17:58, Bernd P <bplumh...@gmail.com> wrote:
> Hello,
>
> Use PERCENTILE with a named range ...
>
> Regards,
> Bernd


Bernd,

PERCENTILE is no good, I have exactly the same problem, the named
ranges must exist on the same worksheet or the formula returns a
#VALUE error.

Thanks,
Reply With Quote
  #7 (permalink)  
Old 07-08-2008, 10:46 AM
dave.mcmanus@gmail.com
 
Posts: n/a
Re: Limitations of Quartile Function

Bernie,

you're a star, that's exactly what I needed. I figured that
converting the multiple ranges into a single range would be the way to
go but I just couldn't think where to start.

Many Thanks,

Dave.
Reply With Quote
  #8 (permalink)  
Old 07-08-2008, 01:42 PM
dave.mcmanus@gmail.com
 
Posts: n/a
Re: Limitations of Quartile Function

Bernie,

this works perfectly but it presents me with one more problem. The
defined ranges may on occasion contain blank cells where the data has
not yet been entered. I need these cells to be ignored so that even
though they are part of the original range I'd need myArr() to exlcude
them.

Any thoughts on this. I'm not getting very far with it.

Thanks,

Dave.



On 7 Jul, 18:12, "Bernie Deitrick" <deitbe @ consumer dot org> wrote:
> Dave,
>
> One way would be to roll your own, with a User-Defined-Function: copy thecode below into a regular
> module and use it like
>
> =MYQUARTILE(B2:B100,Sheet2!B2:B100,1)
>
> HTH,
> Bernie
> MS Excel MVP
>
> Function myQuartile(R1 As Range, R2 As Range, Q As Integer)
> Dim myArr() As Double
> Dim i As Integer
> Dim j As Integer
> Dim k As Integer
>
> i = R1.Cells.Count
> j = R2.Cells.Count
>
> ReDim myArr(1 To i + j)
>
> For k = 1 To i
> * *myArr(k) = R1.Cells(k).Value
> Next k
>
> For k = 1 To j
> * *myArr(i + k) = R2.Cells(k).Value
> Next k
>
> myQuartile = Application.WorksheetFunction.Quartile(myArr, Q)
> End Function
>
> <dave.mcma...@gmail.com> wrote in message
>
> news:47fffde8-f7ef-41c0-9b44-7aec4deb44c5@k37g2000hsf.googlegroups.com...
>
>
>
>
>
> > Bernie,

>
> > unfortunately the data has to stay where it is as there are a whole
> > series of reports and macros already linked to it and the document is
> > a key source of information for several users, I can't go moving
> > things around in it. *One worksheet contains monthly commodity prices,
> > the other contains quarterly commodity prices, they need to stay
> > separate from each other for ease of interpretation. *Also these
> > sheets are updated daily so I can't just copy the data into another
> > workbook for the purposes of mashing it together because then I'd have
> > to update the mashup every day as well (I try to avoid creating
> > unneccessary work for myself wherever possible!).

>
> > So any ideas about how Quartile can use ranges from more than one
> > worksheet at a time?

>
> > Thanks.

>
> > Dave.- Hide quoted text -

>
> - Show quoted text -


Reply With Quote
  #9 (permalink)  
Old 07-08-2008, 03:27 PM
Bernie Deitrick
 
Posts: n/a
Re: Limitations of Quartile Function

Dave,

Try this (untested, since I need to leave soon):

HTH,
Bernie
MS Excel MVP

Function myQuartile(R1 As Range, R2 As Range, Q As Integer)
Dim myArr() As Double
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim p As Integer

i = R1.Cells.Count
j = R2.Cells.Count

ReDim myArr(1 To i + j)

p = 0

For k = 1 To i
If R1.Cells(k).Value <> "" Then

p = p + 1
myArr(p) = R1.Cells(k).Value
End If
Next k

For k = 1 To j

If R2.Cells(k).Value <> "" Then

p = p + 1
myArr(p) = R2.Cells(k).Value
End If
Next k

Redim Preserve myArr(1 To p)

myQuartile = Application.WorksheetFunction.Quartile(myArr, Q)
End Function

<dave.mcmanus@gmail.com> wrote in message
news:8636e1c6-909b-4e62-915a-9631402695a6@m45g2000hsb.googlegroups.com...
Bernie,

this works perfectly but it presents me with one more problem. The
defined ranges may on occasion contain blank cells where the data has
not yet been entered. I need these cells to be ignored so that even
though they are part of the original range I'd need myArr() to exlcude
them.

Any thoughts on this. I'm not getting very far with it.

Thanks,

Dave.



On 7 Jul, 18:12, "Bernie Deitrick" <deitbe @ consumer dot org> wrote:
> Dave,
>
> One way would be to roll your own, with a User-Defined-Function: copy the
> code below into a regular
> module and use it like
>
> =MYQUARTILE(B2:B100,Sheet2!B2:B100,1)
>
> HTH,
> Bernie
> MS Excel MVP
>
> Function myQuartile(R1 As Range, R2 As Range, Q As Integer)
> Dim myArr() As Double
> Dim i As Integer
> Dim j As Integer
> Dim k As Integer
>
> i = R1.Cells.Count
> j = R2.Cells.Count
>
> ReDim myArr(1 To i + j)
>
> For k = 1 To i
> myArr(k) = R1.Cells(k).Value
> Next k
>
> For k = 1 To j
> myArr(i + k) = R2.Cells(k).Value
> Next k
>
> myQuartile = Application.WorksheetFunction.Quartile(myArr, Q)
> End Function
>
> <dave.mcma...@gmail.com> wrote in message
>
> news:47fffde8-f7ef-41c0-9b44-7aec4deb44c5@k37g2000hsf.googlegroups.com...
>
>
>
>
>
> > Bernie,

>
> > unfortunately the data has to stay where it is as there are a whole
> > series of reports and macros already linked to it and the document is
> > a key source of information for several users, I can't go moving
> > things around in it. One worksheet contains monthly commodity prices,
> > the other contains quarterly commodity prices, they need to stay
> > separate from each other for ease of interpretation. Also these
> > sheets are updated daily so I can't just copy the data into another
> > workbook for the purposes of mashing it together because then I'd have
> > to update the mashup every day as well (I try to avoid creating
> > unneccessary work for myself wherever possible!).

>
> > So any ideas about how Quartile can use ranges from more than one
> > worksheet at a time?

>
> > Thanks.

>
> > Dave.- Hide quoted text -

>
> - Show quoted text -



Reply With Quote
  #10 (permalink)  
Old 07-08-2008, 04:13 PM
Bernie Deitrick
 
Posts: n/a
Re: Limitations of Quartile Function

Dave,

I've now had time to test it, and it appears to work.

HTH,
Bernie
MS Excel MVP


"Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
news:u3g9NbQ4IHA.4908@TK2MSFTNGP04.phx.gbl...
> Dave,
>
> Try this (untested, since I need to leave soon):
>
> HTH,
> Bernie
> MS Excel MVP
>
> Function myQuartile(R1 As Range, R2 As Range, Q As Integer)
> Dim myArr() As Double
> Dim i As Integer
> Dim j As Integer
> Dim k As Integer
> Dim p As Integer
>
> i = R1.Cells.Count
> j = R2.Cells.Count
>
> ReDim myArr(1 To i + j)
>
> p = 0
>
> For k = 1 To i
> If R1.Cells(k).Value <> "" Then
>
> p = p + 1
> myArr(p) = R1.Cells(k).Value
> End If
> Next k
>
> For k = 1 To j
>
> If R2.Cells(k).Value <> "" Then
>
> p = p + 1
> myArr(p) = R2.Cells(k).Value
> End If
> Next k
>
> Redim Preserve myArr(1 To p)
>
> myQuartile = Application.WorksheetFunction.Quartile(myArr, Q)
> End Function
>
> <dave.mcmanus@gmail.com> wrote in message
> news:8636e1c6-909b-4e62-915a-9631402695a6@m45g2000hsb.googlegroups.com...
> Bernie,
>
> this works perfectly but it presents me with one more problem. The
> defined ranges may on occasion contain blank cells where the data has
> not yet been entered. I need these cells to be ignored so that even
> though they are part of the original range I'd need myArr() to exlcude
> them.
>
> Any thoughts on this. I'm not getting very far with it.
>
> Thanks,
>
> Dave.
>
>
>
> On 7 Jul, 18:12, "Bernie Deitrick" <deitbe @ consumer dot org> wrote:
>> Dave,
>>
>> One way would be to roll your own, with a User-Defined-Function: copy the code below into a
>> regular
>> module and use it like
>>
>> =MYQUARTILE(B2:B100,Sheet2!B2:B100,1)
>>
>> HTH,
>> Bernie
>> MS Excel MVP
>>
>> Function myQuartile(R1 As Range, R2 As Range, Q As Integer)
>> Dim myArr() As Double
>> Dim i As Integer
>> Dim j As Integer
>> Dim k As Integer
>>
>> i = R1.Cells.Count
>> j = R2.Cells.Count
>>
>> ReDim myArr(1 To i + j)
>>
>> For k = 1 To i
>> myArr(k) = R1.Cells(k).Value
>> Next k
>>
>> For k = 1 To j
>> myArr(i + k) = R2.Cells(k).Value
>> Next k
>>
>> myQuartile = Application.WorksheetFunction.Quartile(myArr, Q)
>> End Function
>>
>> <dave.mcma...@gmail.com> wrote in message
>>
>> news:47fffde8-f7ef-41c0-9b44-7aec4deb44c5@k37g2000hsf.googlegroups.com...
>>
>>
>>
>>
>>
>> > Bernie,

>>
>> > unfortunately the data has to stay where it is as there are a whole
>> > series of reports and macros already linked to it and the document is
>> > a key source of information for several users, I can't go moving
>> > things around in it. One worksheet contains monthly commodity prices,
>> > the other contains quarterly commodity prices, they need to stay
>> > separate from each other for ease of interpretation. Also these
>> > sheets are updated daily so I can't just copy the data into another
>> > workbook for the purposes of mashing it together because then I'd have
>> > to update the mashup every day as well (I try to avoid creating
>> > unneccessary work for myself wherever possible!).

>>
>> > So any ideas about how Quartile can use ranges from more than one
>> > worksheet at a time?

>>
>> > Thanks.

>>
>> > Dave.- Hide quoted text -

>>
>> - Show quoted text -

>
>



Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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



All times are GMT. The time now is 03:35 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Mortgage Calculator | Cheap Sheets | Per Insurance | Bad Credit Mortgages | Loans



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114