Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Lookup referencing ranges that are variable

I have columns of data grouped by date, and the number of names on a given
day are variable. I want to lookup the number associated with a given Name
from the previous day, and if the name did not exist on the previous day I
want to use a simple formula from data on that same line.

I think its a VLOOKUP but the lookup range would need to be variable where
the lookup range for any day is the range of rows from the previous day. In
this example, for 1/2/08, the Number for John (47) needs to be pulled from
John on 1/1. I assume it would be an if statement where if the Name occurs
on the previous day it does a VLOOKUP for the Number, and when it is a new
Name I use a formula (i.e. D3/D4)

Date Name Number
1/1/07 John 47
1/1/08 Mary 22
1/2/08 John 47
1/2/08 Bill 12
1/2/08 Sue 44

Thank You,
Bill Owens
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default Lookup referencing ranges that are variable

Hi,

Suppose your data begins in A1 (titles) and extends down to B5 for the first
day you would not need a formula. Starting on the second day you would enter
a formula such as this (here in C4)
=IF(SUMPRODUCT((A$2:A3=(A4-1))*(B$2:B3=B4))<0,SUMPRODUCT((A$2:A3=(A4-1))*(B$2:B3=B4)*C$2:C3),$F$1/$F$2)

You didn't tell us the "simple formula" you want to use if the name is new,
I used F1/F2.

Be very careful - if two people have the same name you have a problem.

--
Thanks,
Shane Devenshire


"whowens" wrote:

I have columns of data grouped by date, and the number of names on a given
day are variable. I want to lookup the number associated with a given Name
from the previous day, and if the name did not exist on the previous day I
want to use a simple formula from data on that same line.

I think its a VLOOKUP but the lookup range would need to be variable where
the lookup range for any day is the range of rows from the previous day. In
this example, for 1/2/08, the Number for John (47) needs to be pulled from
John on 1/1. I assume it would be an if statement where if the Name occurs
on the previous day it does a VLOOKUP for the Number, and when it is a new
Name I use a formula (i.e. D3/D4)

Date Name Number
1/1/07 John 47
1/1/08 Mary 22
1/2/08 John 47
1/2/08 Bill 12
1/2/08 Sue 44

Thank You,
Bill Owens

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Lookup referencing ranges that are variable

This worked great. thanks!

"whowens" wrote:

I have columns of data grouped by date, and the number of names on a given
day are variable. I want to lookup the number associated with a given Name
from the previous day, and if the name did not exist on the previous day I
want to use a simple formula from data on that same line.

I think its a VLOOKUP but the lookup range would need to be variable where
the lookup range for any day is the range of rows from the previous day. In
this example, for 1/2/08, the Number for John (47) needs to be pulled from
John on 1/1. I assume it would be an if statement where if the Name occurs
on the previous day it does a VLOOKUP for the Number, and when it is a new
Name I use a formula (i.e. D3/D4)

Date Name Number
1/1/07 John 47
1/1/08 Mary 22
1/2/08 John 47
1/2/08 Bill 12
1/2/08 Sue 44

Thank You,
Bill Owens

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
Two Variable Lookup with approximate ranges cardosol Excel Worksheet Functions 12 February 22nd 08 12:59 PM
Variable cell referencing Paul Excel Worksheet Functions 1 February 16th 08 10:55 PM
Referencing tab based on Variable Chad Excel Worksheet Functions 2 June 8th 07 03:48 PM
Variable Cell Referencing 0-0 Wai Wai ^-^ Excel Worksheet Functions 3 June 16th 06 09:34 AM
Referencing Variable Name Worksheets camerons New Users to Excel 8 May 9th 05 09:57 PM


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