Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default last occurance in a array

I have a array of numbers set up I need to find the "last" time a particular
number shows up. i.e. the last time that part number sold. Column A
contains the week number. The cells in columns B to G contain the part
numbers that sold that week. What I need is if in week 32 was the last time
part number 2356 sold. I need a function that will return the 32 with out
looking through the list manually.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
No Name
 
Posts: n/a
Default last occurance in a array

=MAX(IF(B$1:B$100=2356,$A$1:$A$100))

Array Entered (Ctrl + Shift + Enter)


"scidoc" wrote in message
...
I have a array of numbers set up I need to find the "last" time a
particular
number shows up. i.e. the last time that part number sold. Column A
contains the week number. The cells in columns B to G contain the part
numbers that sold that week. What I need is if in week 32 was the last
time
part number 2356 sold. I need a function that will return the 32 with out
looking through the list manually.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 783
Default last occurance in a array

Assuming you have only one years's data (i.e., 52 weeks), should be
=MAX(IF(B$1:G$52=2356,$A$1:$A$52)

Perhaps better still

=MAX(IF(B$1:G$52=H1,$A$1:$A$52)

with the part number in H1.

Alan Beban

- wrote:
=MAX(IF(B$1:B$100=2356,$A$1:$A$100))

Array Entered (Ctrl + Shift + Enter)


"scidoc" wrote in message
...

I have a array of numbers set up I need to find the "last" time a
particular
number shows up. i.e. the last time that part number sold. Column A
contains the week number. The cells in columns B to G contain the part
numbers that sold that week. What I need is if in week 32 was the last
time
part number 2356 sold. I need a function that will return the 32 with out
looking through the list manually.




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default last occurance in a array

I've tried both formulas, all they give me is 0.
I've tried the IF function alone when there is only one occurence of 2356 in
the array B1:G52 and all I get is a false unless the I put the formula in the
same row as the occurence of 2356. Then it returns the vaule in the A1:A52
just like its susposed to. Could it be my version can't do ranges in the IF
function??? I'm using excel 2000 9.0.8961 SP-3.

"Alan Beban" wrote:

Assuming you have only one years's data (i.e., 52 weeks), should be
=MAX(IF(B$1:G$52=2356,$A$1:$A$52)

Perhaps better still

=MAX(IF(B$1:G$52=H1,$A$1:$A$52)

with the part number in H1.

Alan Beban

- wrote:
=MAX(IF(B$1:B$100=2356,$A$1:$A$100))

Array Entered (Ctrl + Shift + Enter)


"scidoc" wrote in message
...

I have a array of numbers set up I need to find the "last" time a
particular
number shows up. i.e. the last time that part number sold. Column A
contains the week number. The cells in columns B to G contain the part
numbers that sold that week. What I need is if in week 32 was the last
time
part number 2356 sold. I need a function that will return the 32 with out
looking through the list manually.





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default last occurance in a array

Array Entered (Ctrl + Shift + Enter)

means this:

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

scidoc wrote:

I've tried both formulas, all they give me is 0.
I've tried the IF function alone when there is only one occurence of 2356 in
the array B1:G52 and all I get is a false unless the I put the formula in the
same row as the occurence of 2356. Then it returns the vaule in the A1:A52
just like its susposed to. Could it be my version can't do ranges in the IF
function??? I'm using excel 2000 9.0.8961 SP-3.

"Alan Beban" wrote:

Assuming you have only one years's data (i.e., 52 weeks), should be
=MAX(IF(B$1:G$52=2356,$A$1:$A$52)

Perhaps better still

=MAX(IF(B$1:G$52=H1,$A$1:$A$52)

with the part number in H1.

Alan Beban

- wrote:
=MAX(IF(B$1:B$100=2356,$A$1:$A$100))

Array Entered (Ctrl + Shift + Enter)


"scidoc" wrote in message
...

I have a array of numbers set up I need to find the "last" time a
particular
number shows up. i.e. the last time that part number sold. Column A
contains the week number. The cells in columns B to G contain the part
numbers that sold that week. What I need is if in week 32 was the last
time
part number 2356 sold. I need a function that will return the 32 with out
looking through the list manually.





--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default last occurance in a array

Did you note the requirement to press Ctrl+Shift+Enter to "enter" the
formula? If not, select the cell with the formula, then click **in** the
formula bar (the cursor must be in the formula bar for this to work) and
press Crtl+Shift+Enter. That should make the formula work correctly for you.

Rick


"scidoc" wrote in message
...
I've tried both formulas, all they give me is 0.
I've tried the IF function alone when there is only one occurence of 2356
in
the array B1:G52 and all I get is a false unless the I put the formula in
the
same row as the occurence of 2356. Then it returns the vaule in the
A1:A52
just like its susposed to. Could it be my version can't do ranges in the
IF
function??? I'm using excel 2000 9.0.8961 SP-3.

"Alan Beban" wrote:

Assuming you have only one years's data (i.e., 52 weeks), should be
=MAX(IF(B$1:G$52=2356,$A$1:$A$52)

Perhaps better still

=MAX(IF(B$1:G$52=H1,$A$1:$A$52)

with the part number in H1.

Alan Beban

- wrote:
=MAX(IF(B$1:B$100=2356,$A$1:$A$100))

Array Entered (Ctrl + Shift + Enter)


"scidoc" wrote in message
...

I have a array of numbers set up I need to find the "last" time a
particular
number shows up. i.e. the last time that part number sold. Column A
contains the week number. The cells in columns B to G contain the part
numbers that sold that week. What I need is if in week 32 was the last
time
part number 2356 sold. I need a function that will return the 32 with
out
looking through the list manually.





  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default last occurance in a array

Here is a formula you can use that can be entered normally...

=SUMPRODUCT(MAX((B1:B53=2356)*(B1:B53<"")*(A1:A53 )))

although I would put the 2356 in a cell, say C1, and then use this
instead...

=SUMPRODUCT(MAX((B1:B53=C1)*(B1:B53<"")*(A1:A53)) )

Put any part number in C1 and the above formula will tell you the week
number is appears in (0 if it doesn't appear anywhere).

Rick


"scidoc" wrote in message
...
I've tried both formulas, all they give me is 0.
I've tried the IF function alone when there is only one occurence of 2356
in
the array B1:G52 and all I get is a false unless the I put the formula in
the
same row as the occurence of 2356. Then it returns the vaule in the
A1:A52
just like its susposed to. Could it be my version can't do ranges in the
IF
function??? I'm using excel 2000 9.0.8961 SP-3.

"Alan Beban" wrote:

Assuming you have only one years's data (i.e., 52 weeks), should be
=MAX(IF(B$1:G$52=2356,$A$1:$A$52)

Perhaps better still

=MAX(IF(B$1:G$52=H1,$A$1:$A$52)

with the part number in H1.

Alan Beban

- wrote:
=MAX(IF(B$1:B$100=2356,$A$1:$A$100))

Array Entered (Ctrl + Shift + Enter)


"scidoc" wrote in message
...

I have a array of numbers set up I need to find the "last" time a
particular
number shows up. i.e. the last time that part number sold. Column A
contains the week number. The cells in columns B to G contain the part
numbers that sold that week. What I need is if in week 32 was the last
time
part number 2356 sold. I need a function that will return the 32 with
out
looking through the list manually.





  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default last occurance in a array

That works great, it will take me a little time (and study) to understand the
logic of how it works though.

"Rick Rothstein (MVP - VB)" wrote:

Here is a formula you can use that can be entered normally...

=SUMPRODUCT(MAX((B1:B53=2356)*(B1:B53<"")*(A1:A53 )))

although I would put the 2356 in a cell, say C1, and then use this
instead...

=SUMPRODUCT(MAX((B1:B53=C1)*(B1:B53<"")*(A1:A53)) )

Put any part number in C1 and the above formula will tell you the week
number is appears in (0 if it doesn't appear anywhere).

Rick


"scidoc" wrote in message
...
I've tried both formulas, all they give me is 0.
I've tried the IF function alone when there is only one occurence of 2356
in
the array B1:G52 and all I get is a false unless the I put the formula in
the
same row as the occurence of 2356. Then it returns the vaule in the
A1:A52
just like its susposed to. Could it be my version can't do ranges in the
IF
function??? I'm using excel 2000 9.0.8961 SP-3.

"Alan Beban" wrote:

Assuming you have only one years's data (i.e., 52 weeks), should be
=MAX(IF(B$1:G$52=2356,$A$1:$A$52)

Perhaps better still

=MAX(IF(B$1:G$52=H1,$A$1:$A$52)

with the part number in H1.

Alan Beban

- wrote:
=MAX(IF(B$1:B$100=2356,$A$1:$A$100))

Array Entered (Ctrl + Shift + Enter)


"scidoc" wrote in message
...

I have a array of numbers set up I need to find the "last" time a
particular
number shows up. i.e. the last time that part number sold. Column A
contains the week number. The cells in columns B to G contain the part
numbers that sold that week. What I need is if in week 32 was the last
time
part number 2356 sold. I need a function that will return the 32 with
out
looking through the list manually.






  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default last occurance in a array

Is there a reason you included the b1:b53<"" factor?

If the cell is equal to 2356, it won't be blank.



"Rick Rothstein (MVP - VB)" wrote:

Here is a formula you can use that can be entered normally...

=SUMPRODUCT(MAX((B1:B53=2356)*(B1:B53<"")*(A1:A53 )))

although I would put the 2356 in a cell, say C1, and then use this
instead...

=SUMPRODUCT(MAX((B1:B53=C1)*(B1:B53<"")*(A1:A53)) )

Put any part number in C1 and the above formula will tell you the week
number is appears in (0 if it doesn't appear anywhere).

Rick

"scidoc" wrote in message
...
I've tried both formulas, all they give me is 0.
I've tried the IF function alone when there is only one occurence of 2356
in
the array B1:G52 and all I get is a false unless the I put the formula in
the
same row as the occurence of 2356. Then it returns the vaule in the
A1:A52
just like its susposed to. Could it be my version can't do ranges in the
IF
function??? I'm using excel 2000 9.0.8961 SP-3.

"Alan Beban" wrote:

Assuming you have only one years's data (i.e., 52 weeks), should be
=MAX(IF(B$1:G$52=2356,$A$1:$A$52)

Perhaps better still

=MAX(IF(B$1:G$52=H1,$A$1:$A$52)

with the part number in H1.

Alan Beban

- wrote:
=MAX(IF(B$1:B$100=2356,$A$1:$A$100))

Array Entered (Ctrl + Shift + Enter)


"scidoc" wrote in message
...

I have a array of numbers set up I need to find the "last" time a
particular
number shows up. i.e. the last time that part number sold. Column A
contains the week number. The cells in columns B to G contain the part
numbers that sold that week. What I need is if in week 32 was the last
time
part number 2356 sold. I need a function that will return the 32 with
out
looking through the list manually.





--

Dave Peterson
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
occurance in each year Anvil22 Excel Worksheet Functions 8 May 10th 07 01:11 AM
Occurance Counting Rusty Excel Worksheet Functions 6 August 6th 06 01:16 PM
frequency of occurance of all words in 2-D array Richard Excel Discussion (Misc queries) 2 March 21st 06 03:13 PM
Need Formula for Last Occurance Reignman Excel Worksheet Functions 2 July 17th 05 08:51 AM
frequency for each occurance bjg Excel Worksheet Functions 3 November 24th 04 02:13 PM


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