Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 54
Default Lookup-value in HLOOKUP?

It seems you can't use a formula (eg "0") as the lookup value in VLOOKUP or
HLOOKUP. Is there a way around this? I have month by month sales data for
a few thousand items for 36 months and I am trying to establish how many
months ago was the last sales activity.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 915
Default Lookup-value in HLOOKUP?

Chrisp wrote:
It seems you can't use a formula (eg "0") as the lookup value in VLOOKUP or
HLOOKUP. Is there a way around this? I have month by month sales data for
a few thousand items for 36 months and I am trying to establish how many
months ago was the last sales activity.


Hi Chrisp, Show us how you have your data organized.
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 54
Default Lookup-value in HLOOKUP?

Hi,

I have table of 36 months of historical data
-Column headings are month/year in order (oldest to newest left to right)
-Row headings are product codes
-Data is the quantity sold for each product each month

With a few thousand products, my challenge is to find a quick way of
calculating for each product how many months have elapsed since the last sale
- ie how many zeros, if any, at the right hand end of each row. This is to
identify products which may be obsolete.

I thought that using HLOOKUP might have some potential, but I am beginning
to think that this may have to be a macro solution.

Would certainly appreciate any ideas you may have.

Many thanks

Chris P


"smartin" wrote:

Chrisp wrote:
It seems you can't use a formula (eg "0") as the lookup value in VLOOKUP or
HLOOKUP. Is there a way around this? I have month by month sales data for
a few thousand items for 36 months and I am trying to establish how many
months ago was the last sales activity.


Hi Chrisp, Show us how you have your data organized.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 915
Default Lookup-value in HLOOKUP?

Hi Chrisp,

With 36 months in columns B:AK starting in row 2, the following array
formula* placed in a convenient column to the right of your data will
return the right-most column number with a non-zero value (*array
formula -- commit with Ctrl+Shift+Enter):

=MAX(--($B2:$AK2<0)*COLUMN($B2:$AK2))

a quick modification tells you how many right-trailing zeros you have on
each row (again, an array formula):

=37-MAX(--($B2:$AK2<0)*COLUMN($B2:$AK2))

Hope this helps!

Chrisp wrote:
Hi,

I have table of 36 months of historical data
-Column headings are month/year in order (oldest to newest left to right)
-Row headings are product codes
-Data is the quantity sold for each product each month

With a few thousand products, my challenge is to find a quick way of
calculating for each product how many months have elapsed since the last sale
- ie how many zeros, if any, at the right hand end of each row. This is to
identify products which may be obsolete.

I thought that using HLOOKUP might have some potential, but I am beginning
to think that this may have to be a macro solution.

Would certainly appreciate any ideas you may have.

Many thanks

Chris P


"smartin" wrote:

Chrisp wrote:
It seems you can't use a formula (eg "0") as the lookup value in VLOOKUP or
HLOOKUP. Is there a way around this? I have month by month sales data for
a few thousand items for 36 months and I am trying to establish how many
months ago was the last sales activity.

Hi Chrisp, Show us how you have your data organized.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 54
Default Lookup-value in HLOOKUP?

Hi smartin,

My apologies for the delay in replying - had hardware problems.

Your proposal is as effective as it is neat. I had put together a very
clunky solution that involved creating another 36 columns that could be
hidden later, each containing a formula to count blank columns. Your idea is
infinitely better.

Many thanks again,

ChrisP

"smartin" wrote:

Hi Chrisp,

With 36 months in columns B:AK starting in row 2, the following array
formula* placed in a convenient column to the right of your data will
return the right-most column number with a non-zero value (*array
formula -- commit with Ctrl+Shift+Enter):

=MAX(--($B2:$AK2<0)*COLUMN($B2:$AK2))

a quick modification tells you how many right-trailing zeros you have on
each row (again, an array formula):

=37-MAX(--($B2:$AK2<0)*COLUMN($B2:$AK2))

Hope this helps!

Chrisp wrote:
Hi,

I have table of 36 months of historical data
-Column headings are month/year in order (oldest to newest left to right)
-Row headings are product codes
-Data is the quantity sold for each product each month

With a few thousand products, my challenge is to find a quick way of
calculating for each product how many months have elapsed since the last sale
- ie how many zeros, if any, at the right hand end of each row. This is to
identify products which may be obsolete.

I thought that using HLOOKUP might have some potential, but I am beginning
to think that this may have to be a macro solution.

Would certainly appreciate any ideas you may have.

Many thanks

Chris P


"smartin" wrote:

Chrisp wrote:
It seems you can't use a formula (eg "0") as the lookup value in VLOOKUP or
HLOOKUP. Is there a way around this? I have month by month sales data for
a few thousand items for 36 months and I am trying to establish how many
months ago was the last sales activity.
Hi Chrisp, Show us how you have your data organized.


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 combine vlookup with hlookup Doug Excel Worksheet Functions 2 April 23rd 23 11:42 AM
HLOOKUP, VLOOKUP, LOOKUP??? Connie Martin Excel Worksheet Functions 10 October 23rd 08 06:02 PM
'IF','LOOKUP' or 'HLOOKUP'? Rajan Iyer Excel Worksheet Functions 4 July 31st 07 12:44 AM
HLOOKUP - Adjusting the lookup value... Regnab Excel Discussion (Misc queries) 3 May 22nd 06 11:14 AM
Multiple lookup values in =HLOOKUP Peter Excel Discussion (Misc queries) 1 September 17th 05 08:38 PM


All times are GMT +1. The time now is 03:58 AM.

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"