Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default how to return an address from a lookup into a table?

In my workbook, one worksheet (Tab1) should contain several formulas
structured as:

=AVERAGE('Tab2'!Address1:Address2)

The other worksheet (Tab2) contains a table, in which column A are all dates
from the last 5 years, in ascending order, and column B the corresponding
target values.

Address1 and Address2 are the cells in column B of Tab2 located on the same
rows as the cells in column A that contain Date1 and Date2, respectively.

Date1 and Date2 are cells (containing dates) in Tab1.

My goal is to have each formula in Tab1, given Date1 and Date2, calculate an
average of target values retrieved from the table in Tab2.

How should I complete the formulas? Should a Lookup function be used?

Many thanks.
Chap
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default how to return an address from a lookup into a table?

Sorry, I didn't quite get it.
What would be the named ranges? ChecksA and ChecksD? For the dates and for
the target values? And the Date1 and Date2 values I mentioned, where would
they come in? As R2 and S2?


"Don Guillett" wrote:

Assumes named ranges and valid dates. An array formula that must be entered
using ctrl + shift +enter

=AVERAGE(IF((ChecksA=R2)*(ChecksA<=S2),ChecksD))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Chap" wrote in message
...
In my workbook, one worksheet (Tab1) should contain several formulas
structured as:

=AVERAGE('Tab2'!Address1:Address2)

The other worksheet (Tab2) contains a table, in which column A are all
dates
from the last 5 years, in ascending order, and column B the corresponding
target values.

Address1 and Address2 are the cells in column B of Tab2 located on the
same
rows as the cells in column A that contain Date1 and Date2, respectively.

Date1 and Date2 are cells (containing dates) in Tab1.

My goal is to have each formula in Tab1, given Date1 and Date2, calculate
an
average of target values retrieved from the table in Tab2.

How should I complete the formulas? Should a Lookup function be used?

Many thanks.
Chap



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default how to return an address from a lookup into a table?

Why not simplify matters?

Starting date in C1 of Sheet1,
Ending date in C2 of Sheet1,
Range on Sheet2:
A2 to A100 - dates (in any order)
B2 to B100 - values

Try this formula:

=SUMPRODUCT((Sheet2!A2:A100=C1)*(Sheet2!A2:A100<= C2)*Sheet2!B2:B100)/
SUMPRODUCT((Sheet2!A2:A100=C1)*(Sheet2!A2:A100<=C 2))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Chap" wrote in message
...
Sorry, I didn't quite get it.
What would be the named ranges? ChecksA and ChecksD? For the dates and for
the target values? And the Date1 and Date2 values I mentioned, where would
they come in? As R2 and S2?


"Don Guillett" wrote:

Assumes named ranges and valid dates. An array formula that must be

entered
using ctrl + shift +enter

=AVERAGE(IF((ChecksA=R2)*(ChecksA<=S2),ChecksD))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Chap" wrote in message
...
In my workbook, one worksheet (Tab1) should contain several formulas
structured as:

=AVERAGE('Tab2'!Address1:Address2)

The other worksheet (Tab2) contains a table, in which column A are all
dates
from the last 5 years, in ascending order, and column B the

corresponding
target values.

Address1 and Address2 are the cells in column B of Tab2 located on the
same
rows as the cells in column A that contain Date1 and Date2,

respectively.

Date1 and Date2 are cells (containing dates) in Tab1.

My goal is to have each formula in Tab1, given Date1 and Date2,

calculate
an
average of target values retrieved from the table in Tab2.

How should I complete the formulas? Should a Lookup function be used?

Many thanks.
Chap




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default how to return an address from a lookup into a table?

checksA would have dates and checksD the values
r2 date1 and s2 date2

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Chap" wrote in message
...
Sorry, I didn't quite get it.
What would be the named ranges? ChecksA and ChecksD? For the dates and for
the target values? And the Date1 and Date2 values I mentioned, where would
they come in? As R2 and S2?


"Don Guillett" wrote:

Assumes named ranges and valid dates. An array formula that must be
entered
using ctrl + shift +enter

=AVERAGE(IF((ChecksA=R2)*(ChecksA<=S2),ChecksD))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Chap" wrote in message
...
In my workbook, one worksheet (Tab1) should contain several formulas
structured as:

=AVERAGE('Tab2'!Address1:Address2)

The other worksheet (Tab2) contains a table, in which column A are all
dates
from the last 5 years, in ascending order, and column B the
corresponding
target values.

Address1 and Address2 are the cells in column B of Tab2 located on the
same
rows as the cells in column A that contain Date1 and Date2,
respectively.

Date1 and Date2 are cells (containing dates) in Tab1.

My goal is to have each formula in Tab1, given Date1 and Date2,
calculate
an
average of target values retrieved from the table in Tab2.

How should I complete the formulas? Should a Lookup function be used?

Many thanks.
Chap






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default how to return an address from a lookup into a table?

Thanks, it worked.

"Ragdyer" wrote:

Why not simplify matters?

Starting date in C1 of Sheet1,
Ending date in C2 of Sheet1,
Range on Sheet2:
A2 to A100 - dates (in any order)
B2 to B100 - values

Try this formula:

=SUMPRODUCT((Sheet2!A2:A100=C1)*(Sheet2!A2:A100<= C2)*Sheet2!B2:B100)/
SUMPRODUCT((Sheet2!A2:A100=C1)*(Sheet2!A2:A100<=C 2))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Chap" wrote in message
...
Sorry, I didn't quite get it.
What would be the named ranges? ChecksA and ChecksD? For the dates and for
the target values? And the Date1 and Date2 values I mentioned, where would
they come in? As R2 and S2?


"Don Guillett" wrote:

Assumes named ranges and valid dates. An array formula that must be

entered
using ctrl + shift +enter

=AVERAGE(IF((ChecksA=R2)*(ChecksA<=S2),ChecksD))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Chap" wrote in message
...
In my workbook, one worksheet (Tab1) should contain several formulas
structured as:

=AVERAGE('Tab2'!Address1:Address2)

The other worksheet (Tab2) contains a table, in which column A are all
dates
from the last 5 years, in ascending order, and column B the

corresponding
target values.

Address1 and Address2 are the cells in column B of Tab2 located on the
same
rows as the cells in column A that contain Date1 and Date2,

respectively.

Date1 and Date2 are cells (containing dates) in Tab1.

My goal is to have each formula in Tab1, given Date1 and Date2,

calculate
an
average of target values retrieved from the table in Tab2.

How should I complete the formulas? Should a Lookup function be used?

Many thanks.
Chap




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default how to return an address from a lookup into a table?

Right, but there is a problem - the formula, as I wrote it, is not being
accepted (and I did not forget the ctrl-shift-enter). I reviewed it carefully
and it seems consistent with yours. Could you please review it, just in case
you left out something?
Sorry for all the trouble.
BTW, your solution looks very elegant to me.


"Don Guillett" wrote:

checksA would have dates and checksD the values
r2 date1 and s2 date2

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Chap" wrote in message
...
Sorry, I didn't quite get it.
What would be the named ranges? ChecksA and ChecksD? For the dates and for
the target values? And the Date1 and Date2 values I mentioned, where would
they come in? As R2 and S2?


"Don Guillett" wrote:

Assumes named ranges and valid dates. An array formula that must be
entered
using ctrl + shift +enter

=AVERAGE(IF((ChecksA=R2)*(ChecksA<=S2),ChecksD))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Chap" wrote in message
...
In my workbook, one worksheet (Tab1) should contain several formulas
structured as:

=AVERAGE('Tab2'!Address1:Address2)

The other worksheet (Tab2) contains a table, in which column A are all
dates
from the last 5 years, in ascending order, and column B the
corresponding
target values.

Address1 and Address2 are the cells in column B of Tab2 located on the
same
rows as the cells in column A that contain Date1 and Date2,
respectively.

Date1 and Date2 are cells (containing dates) in Tab1.

My goal is to have each formula in Tab1, given Date1 and Date2,
calculate
an
average of target values retrieved from the table in Tab2.

How should I complete the formulas? Should a Lookup function be used?

Many thanks.
Chap




  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default how to return an address from a lookup into a table?

Did you try to retype Don's formula, or did you copy it from the newsgroup
and paste into your formula toolbar?
When you say "it is not being accepted", what error message did you get from
Excel?
Normally if Excel won't accept a formula it will try to put the cursor where
it thinks there may be an error. If so, where does it put the cursor?
Don has assumed that your Windows regional settings use a comma as a list
separator; do your settings use a semi-colon? If so, replace the comma in
Don's formula by a semi-colon.
Are you sure that you've got the required named ranges ChecksA and ChecksD?
[You can check with Insert/ Name/ Define...] If not, Excel will still
accept the formula, but you will get a #NAME? result from the formula.
Are you sure that the two named ranges have the same length?
--
David Biddulph

Chap wrote:
Right, but there is a problem - the formula, as I wrote it, is not
being accepted (and I did not forget the ctrl-shift-enter). I
reviewed it carefully and it seems consistent with yours. Could you
please review it, just in case you left out something?
Sorry for all the trouble.
BTW, your solution looks very elegant to me.


"Don Guillett" wrote:

checksA would have dates and checksD the values
r2 date1 and s2 date2

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Chap" wrote in message
...
Sorry, I didn't quite get it.
What would be the named ranges? ChecksA and ChecksD? For the dates
and for the target values? And the Date1 and Date2 values I
mentioned, where would they come in? As R2 and S2?


"Don Guillett" wrote:

Assumes named ranges and valid dates. An array formula that must be
entered
using ctrl + shift +enter

=AVERAGE(IF((ChecksA=R2)*(ChecksA<=S2),ChecksD))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Chap" wrote in message
...
In my workbook, one worksheet (Tab1) should contain several
formulas structured as:

=AVERAGE('Tab2'!Address1:Address2)

The other worksheet (Tab2) contains a table, in which column A
are all dates
from the last 5 years, in ascending order, and column B the
corresponding
target values.

Address1 and Address2 are the cells in column B of Tab2 located
on the same
rows as the cells in column A that contain Date1 and Date2,
respectively.

Date1 and Date2 are cells (containing dates) in Tab1.

My goal is to have each formula in Tab1, given Date1 and Date2,
calculate
an
average of target values retrieved from the table in Tab2.

How should I complete the formulas? Should a Lookup function be
used?

Many thanks.
Chap



  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default how to return an address from a lookup into a table?

It was the list separator, how stupid of me.

The formula works perfectly, and looks brilliant.

Many thanks, guys!


"David Biddulph" wrote:

Did you try to retype Don's formula, or did you copy it from the newsgroup
and paste into your formula toolbar?
When you say "it is not being accepted", what error message did you get from
Excel?
Normally if Excel won't accept a formula it will try to put the cursor where
it thinks there may be an error. If so, where does it put the cursor?
Don has assumed that your Windows regional settings use a comma as a list
separator; do your settings use a semi-colon? If so, replace the comma in
Don's formula by a semi-colon.
Are you sure that you've got the required named ranges ChecksA and ChecksD?
[You can check with Insert/ Name/ Define...] If not, Excel will still
accept the formula, but you will get a #NAME? result from the formula.
Are you sure that the two named ranges have the same length?
--
David Biddulph

Chap wrote:
Right, but there is a problem - the formula, as I wrote it, is not
being accepted (and I did not forget the ctrl-shift-enter). I
reviewed it carefully and it seems consistent with yours. Could you
please review it, just in case you left out something?
Sorry for all the trouble.
BTW, your solution looks very elegant to me.


"Don Guillett" wrote:

checksA would have dates and checksD the values
r2 date1 and s2 date2

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Chap" wrote in message
...
Sorry, I didn't quite get it.
What would be the named ranges? ChecksA and ChecksD? For the dates
and for the target values? And the Date1 and Date2 values I
mentioned, where would they come in? As R2 and S2?


"Don Guillett" wrote:

Assumes named ranges and valid dates. An array formula that must be
entered
using ctrl + shift +enter

=AVERAGE(IF((ChecksA=R2)*(ChecksA<=S2),ChecksD))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Chap" wrote in message
...
In my workbook, one worksheet (Tab1) should contain several
formulas structured as:

=AVERAGE('Tab2'!Address1:Address2)

The other worksheet (Tab2) contains a table, in which column A
are all dates
from the last 5 years, in ascending order, and column B the
corresponding
target values.

Address1 and Address2 are the cells in column B of Tab2 located
on the same
rows as the cells in column A that contain Date1 and Date2,
respectively.

Date1 and Date2 are cells (containing dates) in Tab1.

My goal is to have each formula in Tab1, given Date1 and Date2,
calculate
an
average of target values retrieved from the table in Tab2.

How should I complete the formulas? Should a Lookup function be
used?

Many thanks.
Chap




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
LOOKUP & RETURN CELL ADDRESS Carolan Excel Worksheet Functions 12 June 2nd 08 07:53 AM
Lookup, and Return Cell Address ryguy7272 Excel Worksheet Functions 7 September 22nd 07 09:46 AM
VLOOKUP CONDITION TO RETURN BLANK CELL WHERE LOOKUP VALUE IS NOT IN TABLE ARRAY Scott Lolmaugh Excel Worksheet Functions 3 March 9th 06 11:05 PM
V Lookup and return cell address Thomas Excel Worksheet Functions 1 January 30th 06 08:09 PM
need Lookup table to return null or zero simbob Excel Worksheet Functions 5 September 24th 05 01:55 PM


All times are GMT +1. The time now is 04:23 PM.

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

About Us

"It's about Microsoft Excel"