Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / February 2008

Tip: Looking for answers? Try searching our database.

Newbie with array-problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nilserik.oscarsson@telia.com - 07 Feb 2008 17:48 GMT
I have 7 arrays with 15 elements in each. I need to combine every
element, one from each array for each loop and compare the sum of
these 7 values with an intervall to se if the value should be passed
on. How to find a smart solution that want be to heavy on the Excel-
program and on the computer. Is it possible or am I reaching for the
moon? Thanks in advance for any suggestions.
Ron Rosenfeld - 07 Feb 2008 18:36 GMT
>I have 7 arrays with 15 elements in each. I need to combine every
>element, one from each array for each loop and compare the sum of
>these 7 values with an intervall to se if the value should be passed
>on. How to find a smart solution that want be to heavy on the Excel-
>program and on the computer. Is it possible or am I reaching for the
>moon? Thanks in advance for any suggestions.

It shouldn't be too hard.  Post some more information as to the type of data
and how the arrays are stored or entered.
--ron
nilserik.oscarsson@telia.com - 07 Feb 2008 19:43 GMT
> >I have 7 arrays with 15 elements in each. I need to combine every
> >element, one from eacharrayfor each loop and compare the sum of
[quoted text clipped - 6 lines]
> and how the arrays are stored or entered.
> --ron

Nmeric values - the interval of comparison is entered as parameters
nilserik.oscarsson@telia.com - 07 Feb 2008 20:13 GMT
On Feb 7, 8:43 pm, nilserik.oscars...@telia.com wrote:

> > >I have 7 arrays with 15 elements in each. I need to combine every
> > >element, one from eacharrayfor each loop and compare the sum of
[quoted text clipped - 8 lines]
>
> Nmeric values - the interval of comparison is entered as parameters

Sorry - fast answer - the values are already in the arrays and are
numeric so that is not the problem. The intervall is passed to the
macro as parameters. My problem is th loop with so many arrays and not
breaking the memory or the program. My math is not that good in
finding a "maximal solution" - sorry for the earlier incorrrect answer.
Ron Rosenfeld - 07 Feb 2008 21:08 GMT
>On Feb 7, 8:43 pm, nilserik.oscars...@telia.com wrote:
>>
[quoted text clipped - 16 lines]
>breaking the memory or the program. My math is not that good in
>finding a "maximal solution" - sorry for the earlier incorrrect answer.

Well, if you just want to sum the total of each nth element in a bunch of
arrays, something like:

for i = lbound(array) to ubound(array)
    dTemp = array1(i) + array2(i) + array3(i) ... + array7(i)
    if dTemp = interval then
        pass it on
    end if
next i

--ron
nilserik.oscarsson@telia.com - 07 Feb 2008 22:05 GMT
> >On Feb 7, 8:43 pm, nilserik.oscars...@telia.com wrote:
>
[quoted text clipped - 28 lines]
>
> --ron

It does not cobmbine all values in all array elements - only 15.
I tried to define lbound/ubound as Array1/Array7 or as a seperar Array/
Array with 15 elements?? but the same result. How to define nbr of
elements in ARRAY?
Ron Rosenfeld - 07 Feb 2008 23:23 GMT
>It does not cobmbine all values in all array elements - only 15.
>I tried to define lbound/ubound as Array1/Array7 or as a seperar Array/
>Array with 15 elements?? but the same result. How to define nbr of
>elements in ARRAY?

If you can't adapt what I posted to your circumstance, you are going to have to
provide more specifics.

What you write may be clear to you, but it is not clear to me.
--ron
nilserik.oscarsson@telia.com - 07 Feb 2008 23:44 GMT
> >It does not cobmbine all values in all array elements - only 15.
> >I tried to define lbound/ubound as Array1/Array7 or as a seperar Array/
[quoted text clipped - 6 lines]
> What you write may be clear to you, but it is not clear to me.
> --ron

Sorry - thanks for your time. I wont to make these combinations for
EVERY elements (E) in EVERY array (A)
Ex: Array1 element 1 to 15 combined with element 1 in array 2-7, with
element 2 in array 2-7,with element 3 in array 2-7 and so on until or
combinations are covered between the arrays. Does this make any
sense ?? - this is why it is so hard to make without breaking the
memory or the computer. Your solution only takes A1E1, A2E1...A1E2,
A2E2.. or have I completle misunderstood your solution
nilserik.oscarsson@telia.com - 07 Feb 2008 23:57 GMT
On Feb 8, 12:44 am, nilserik.oscars...@telia.com wrote:

> > >It does not cobmbine all values in all array elements - only 15.
> > >I tried to define lbound/ubound as Array1/Array7 or as a seperar Array/
[quoted text clipped - 15 lines]
> memory or the computer. Your solution only takes A1E1, A2E1...A1E2,
> A2E2.. or have I completle misunderstood your solution

I have tried to nest your loop but it breaks down the memory, but
seems to work when debuging at least as long I tried
for A1 = lbound(array1) to ubound(array1)
for A2 = lbound(array2) to ubound(array2)
....
....
       dTemp = array1(a1) + array2(a2) + array3(a3) ... + array7(a7)
Ron Rosenfeld - 08 Feb 2008 01:21 GMT
>Sorry - thanks for your time. I wont to make these combinations for
>EVERY elements (E) in EVERY array (A)
[quoted text clipped - 4 lines]
>memory or the computer. Your solution only takes A1E1, A2E1...A1E2,
>A2E2.. or have I completle misunderstood your solution

I don't think you've misunderstood my solution.

My solution basically does this:

A1 = ARRAY1
E1 = ELEMENT1

=A1E1+A2E1+A3E1+A4E1+A5E1+A6E1+A7E1

Then compare that SUM with interval

Then do

=A1E2+A2E2+A3E2+A4E2+A5E2+A6E2+A7E2

and compare the SUM with interval

and repeat to

=A1E15+A2E15+A3E15+A4E15+A5E15+A6E15+A7E15

--ron
nilserik.oscarsson@telia.com - 08 Feb 2008 06:06 GMT
> >Sorry - thanks for your time. I wont to make these combinations for
> >EVERY elements (E) in EVERY array (A)
[quoted text clipped - 27 lines]
>
> --ron

Thanks for you time - as I said earlier - that's what your souloution
does - not combine all elements in alla arrays with each other
nilserik.oscarsson@telia.com - 08 Feb 2008 12:24 GMT
> >Sorry - thanks for your time. I wont to make these combinations for
> >EVERY elements (E) in EVERY array (A)
[quoted text clipped - 27 lines]
>
> --ron

Thanks very much Ron. With a pre-routine taking away "to high values"
in each array and nesting your solution (se earlier) I managed to
reduce the nbr of elements to calculate in each array and all went
well. I used "For x = y to z" to reduce the loops. Your a smart guy,
perhaps to smart for a newbie (novis in Excel) like me - many thanks.
Ron Rosenfeld - 08 Feb 2008 12:43 GMT
>Thanks very much Ron. With a pre-routine taking away "to high values"
>in each array and nesting your solution (se earlier) I managed to
>reduce the nbr of elements to calculate in each array and all went
>well. I used "For x = y to z" to reduce the loops. Your a smart guy,
>perhaps to smart for a newbie (novis in Excel) like me - many thanks.

Even though I couldn't give you a complete solution, I'm happy to have given
you some hints that enabled you to develop one on your own.

And I've never been accused of being "too smart" before -- just ask my wife!
<g>
--ron
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.