Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Use index to get range for dget to use

I have a dget function that I want to use different range and criteria ranges
depending on a flag. I thought that index would work but I am getting a
value error. Thanks in advance for any help.

Here's the formula:

=dget(index(rangearray,1),az11,index(rangearray,3) )

whrere
Med1_602
Med2_602
Med1_602Crit
Med2_602

are in a range called rangearray. These are all ranges that I want to use
in the dget formula depending on other criteria.

If I do the index function independently it gives me the correct range but
in the dget formula I get an error?

Thanks, I posted this last week on the function area, but didn't receive a
solution, hoping someone here know one.

Thanks in advance for any help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Use index to get range for dget to use

Hi Adella

What i think happens is

The part INDEX(rangearray,1) returns the string (value) in rangearray
having index 1. The result is say "Med1_602". But this result is a String not
a range; you could even replace that specific cell by ="Med1_602", same
result. So, it's understood as a String and XL doesn't try to match it with
any Named Range.
That is you need to transform this string into a range having the same name.
You can use the INDIRECT function for that:

In C1:C3, enter the values 1, 2, 3
In A1, enter the string: "C1"
--- this is just the String "C1", not a range
--- the cell displays 'C1' and not the value in the
range C1
In A2, try: =INDIRECT(A1)
---- now it shows the value in C1
ie: get the value in the range corresponding to the
value in A1

Now with your INDEX function it would be
INDIRECT(index(rangearray),1))
--- index(rangearray),1 returns 'Med1_602'
--- then INDIRECT("Med1_602") returns the named range Med1_602

I hope this helps
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Adella" wrote:

I have a dget function that I want to use different range and criteria ranges
depending on a flag. I thought that index would work but I am getting a
value error. Thanks in advance for any help.

Here's the formula:

=dget(index(rangearray,1),az11,index(rangearray,3) )

whrere
Med1_602
Med2_602
Med1_602Crit
Med2_602

are in a range called rangearray. These are all ranges that I want to use
in the dget formula depending on other criteria.

If I do the index function independently it gives me the correct range but
in the dget formula I get an error?

Thanks, I posted this last week on the function area, but didn't receive a
solution, hoping someone here know one.

Thanks in advance for any help.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Use index to get range for dget to use

Sebastienm,

This works great!

Thanks,

Adella

"sebastienm" wrote:

Hi Adella

What i think happens is

The part INDEX(rangearray,1) returns the string (value) in rangearray
having index 1. The result is say "Med1_602". But this result is a String not
a range; you could even replace that specific cell by ="Med1_602", same
result. So, it's understood as a String and XL doesn't try to match it with
any Named Range.
That is you need to transform this string into a range having the same name.
You can use the INDIRECT function for that:

In C1:C3, enter the values 1, 2, 3
In A1, enter the string: "C1"
--- this is just the String "C1", not a range
--- the cell displays 'C1' and not the value in the
range C1
In A2, try: =INDIRECT(A1)
---- now it shows the value in C1
ie: get the value in the range corresponding to the
value in A1

Now with your INDEX function it would be
INDIRECT(index(rangearray),1))
--- index(rangearray),1 returns 'Med1_602'
--- then INDIRECT("Med1_602") returns the named range Med1_602

I hope this helps
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Adella" wrote:

I have a dget function that I want to use different range and criteria ranges
depending on a flag. I thought that index would work but I am getting a
value error. Thanks in advance for any help.

Here's the formula:

=dget(index(rangearray,1),az11,index(rangearray,3) )

whrere
Med1_602
Med2_602
Med1_602Crit
Med2_602

are in a range called rangearray. These are all ranges that I want to use
in the dget formula depending on other criteria.

If I do the index function independently it gives me the correct range but
in the dget formula I get an error?

Thanks, I posted this last week on the function area, but didn't receive a
solution, hoping someone here know one.

Thanks in advance for any help.

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
DGET only limited to 1000 Rows, but I need 8000 rows for DGET funt Chiann Looker Excel Worksheet Functions 1 March 9th 10 02:36 AM
DGET Function - using a split criteria range? (Excel 2007) MikeT Excel Worksheet Functions 0 August 11th 08 10:37 PM
Index by Range BC Excel Worksheet Functions 4 June 29th 06 12:39 AM
Use Index to get range Adella Excel Worksheet Functions 4 November 17th 05 05:56 PM
dynamic, double vlookup, match, index, dget?? different workbooks Leslie Excel Worksheet Functions 11 June 27th 05 09:45 PM


All times are GMT +1. The time now is 12:29 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"