Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Katie
 
Posts: n/a
Default How to find the first nonzero cell in a row

I have a worksheet that has store names as rows, week numbers as columns, and
inventory quantities as cells. I need a column that has a formula that shows
the first week that has inventory at each store.

Basically, I need to find the the column with the first non-zero cell in
each row, then return the week number listed at the top of that column in the
column header. I need the appropriate weeknumber for each row.

Any ideas would be appreciated!

Thanks

Katie
  #2   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default How to find the first nonzero cell in a row

On Mon, 17 Oct 2005 12:26:04 -0700, "Katie"
wrote:

I have a worksheet that has store names as rows, week numbers as columns, and
inventory quantities as cells. I need a column that has a formula that shows
the first week that has inventory at each store.

Basically, I need to find the the column with the first non-zero cell in
each row, then return the week number listed at the top of that column in the
column header. I need the appropriate weeknumber for each row.

Any ideas would be appreciated!

Thanks

Katie


Assumptions:

1. Your week numbers are in row 1
2. Your weeknumbers and data start in Column D

This **array** formula will return the contents of row1 that is in the same
column as the first non-zero contents of the referenced row (row 3 in this
instance):

=INDEX($D$1:$IV$1,,MATCH(TRUE,D3:IV30,0))

You can copy/drag the formula down as needed.

To enter an array formula, after typing or pasting it in, you must hold down
<ctrl<shift while hitting <enter. Excel will place braces {...} around the
formula if you did it correctly.


--ron
  #3   Report Post  
Katie
 
Posts: n/a
Default How to find the first nonzero cell in a row

Thanks! That worked perfectly.

"Ron Rosenfeld" wrote:

On Mon, 17 Oct 2005 12:26:04 -0700, "Katie"
wrote:

I have a worksheet that has store names as rows, week numbers as columns, and
inventory quantities as cells. I need a column that has a formula that shows
the first week that has inventory at each store.

Basically, I need to find the the column with the first non-zero cell in
each row, then return the week number listed at the top of that column in the
column header. I need the appropriate weeknumber for each row.

Any ideas would be appreciated!

Thanks

Katie


Assumptions:

1. Your week numbers are in row 1
2. Your weeknumbers and data start in Column D

This **array** formula will return the contents of row1 that is in the same
column as the first non-zero contents of the referenced row (row 3 in this
instance):

=INDEX($D$1:$IV$1,,MATCH(TRUE,D3:IV30,0))

You can copy/drag the formula down as needed.

To enter an array formula, after typing or pasting it in, you must hold down
<ctrl<shift while hitting <enter. Excel will place braces {...} around the
formula if you did it correctly.


--ron

  #4   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default How to find the first nonzero cell in a row

On Mon, 17 Oct 2005 13:13:04 -0700, "Katie"
wrote:

Thanks! That worked perfectly.


You're most welcome. Thanks for the feedback.

--ron
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Lmm Lmm is offline
external usenet poster
 
Posts: 5
Default How to find the first nonzero cell in a row

Hi,

I tried the INDEX & MATCH formulas and it works! But if my row # is
dynamic, i.e. take your example below that if row 3 be replaced with
different row #, how to incorporate the dynamic # in MATCH.

Lmm

"Katie" wrote:

Thanks! That worked perfectly.

"Ron Rosenfeld" wrote:

On Mon, 17 Oct 2005 12:26:04 -0700, "Katie"
wrote:

I have a worksheet that has store names as rows, week numbers as columns, and
inventory quantities as cells. I need a column that has a formula that shows
the first week that has inventory at each store.

Basically, I need to find the the column with the first non-zero cell in
each row, then return the week number listed at the top of that column in the
column header. I need the appropriate weeknumber for each row.

Any ideas would be appreciated!

Thanks

Katie


Assumptions:

1. Your week numbers are in row 1
2. Your weeknumbers and data start in Column D

This **array** formula will return the contents of row1 that is in the same
column as the first non-zero contents of the referenced row (row 3 in this
instance):

=INDEX($D$1:$IV$1,,MATCH(TRUE,D3:IV30,0))

You can copy/drag the formula down as needed.

To enter an array formula, after typing or pasting it in, you must hold down
<ctrl<shift while hitting <enter. Excel will place braces {...} around the
formula if you did it correctly.


--ron



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 915
Default How to find the first nonzero cell in a row

Lmm wrote:
Hi,

I tried the INDEX & MATCH formulas and it works! But if my row # is
dynamic, i.e. take your example below that if row 3 be replaced with
different row #, how to incorporate the dynamic # in MATCH.


Hi Lmm,

[snipped]
=INDEX($D$1:$IV$1,,MATCH(TRUE,D3:IV30,0))

In this case row 3 was just an example. Start with the formula in row 3
and fill down, it will adjust.
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Lmm Lmm is offline
external usenet poster
 
Posts: 5
Default How to find the first nonzero cell in a row



"smartin" wrote:

Lmm wrote:
Hi,

I tried the INDEX & MATCH formulas and it works! But if my row # is
dynamic, i.e. take your example below that if row 3 be replaced with
different row #, how to incorporate the dynamic # in MATCH.


Hi Lmm,

[snipped]
=INDEX($D$1:$IV$1,,MATCH(TRUE,D3:IV30,0))

In this case row 3 was just an example. Start with the formula in row 3
and fill down, it will adjust.


I didn't express my question clearer. Take this example that each inventory
row represents one SKU commit wk units. By giving one SKU and find out the
first nonzero cell for that SKU row is what I am looking for. I am not doing
serial request for all rows together. In summary, if I find the row # for
one specific SKU in qeustion, how to incorporate the row # into the formula?
Thanks.

Lmm
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
Find a empty cell in next column Michael Excel Discussion (Misc queries) 3 June 15th 05 02:18 PM
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM
How do I find out how many different cell formats an existing wor. wheelsii Excel Discussion (Misc queries) 1 March 24th 05 04:58 PM
Find Max and Min based on cell reference gregork Excel Discussion (Misc queries) 3 February 21st 05 12:28 AM
I there an easy way to find out if any formula reference a cell? Marc New Users to Excel 1 December 6th 04 10:41 PM


All times are GMT +1. The time now is 04:11 AM.

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"