Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 52
Default Find Last Occurrence of Number

Hi, I'm trying to work out how if I have the data (as seen below in "Sheet
3"), how to use that to populate "Sheet 2" as shown.

I'm wanting to find the "name" in sheet 3 column B that is the last
occurrence of that value in column A that corresponds with the value in sheet
2 column A as long as sheet 3 column C is blank.

Sheet 3
A B C
1 5 Name 1 12/01/2009
2 1 Name 2 10/01/2009
3 5 Name 3
4 4 Name 4
5 2 Name 5

Sheet 2
A B C
1 1
2 2 Name 5
3 3
4 4 Name 4
5 5 Name 3

Thanks in advance
Kim

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 52
Default Find Last Occurrence of Number

I also forgot to mention that the columns in sheet 3 will continually have
data added to them.

Any help with this would be great thanks.

"KimC" wrote:

Hi, I'm trying to work out how if I have the data (as seen below in "Sheet
3"), how to use that to populate "Sheet 2" as shown.

I'm wanting to find the "name" in sheet 3 column B that is the last
occurrence of that value in column A that corresponds with the value in sheet
2 column A as long as sheet 3 column C is blank.

Sheet 3
A B C
1 5 Name 1 12/01/2009
2 1 Name 2 10/01/2009
3 5 Name 3
4 4 Name 4
5 2 Name 5

Sheet 2
A B C
1 1
2 2 Name 5
3 3
4 4 Name 4
5 5 Name 3

Thanks in advance
Kim

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Find Last Occurrence of Number

This is a little bit complicated. You need an IF so you don't get N/A
results when you don't return anything. The formula is in the lookup
function is in the equation twice to aviod the N/A.

The lookup array return something like this

=Lookup(2,1/{1,0,0,1,1,0,1},C1:C7)

=Lookup(2,{1,DIV 0,DIV 0,1,1,DIV 0,1},C1:C7)

The number two will never match anything exactly in the array. So instead
it returns the last 1 in the array which is the number smaller than 2. The
DIV 0 is a very large number.


=IF(ISNA(LOOKUP(2,1/(--(Sheet3!$A$1:$A$100=A1)*--(Sheet3!$C$1:$C$100="")),Sheet3!$B$1:$B$100)),"",L OOKUP(2,1/(--(Sheet3!$A$1:$A$100=A1)*--(Sheet3!$C$1:$C$100="")),Sheet3!$B$1:$B$100))

"KimC" wrote:

Hi, I'm trying to work out how if I have the data (as seen below in "Sheet
3"), how to use that to populate "Sheet 2" as shown.

I'm wanting to find the "name" in sheet 3 column B that is the last
occurrence of that value in column A that corresponds with the value in sheet
2 column A as long as sheet 3 column C is blank.

Sheet 3
A B C
1 5 Name 1 12/01/2009
2 1 Name 2 10/01/2009
3 5 Name 3
4 4 Name 4
5 2 Name 5

Sheet 2
A B C
1 1
2 2 Name 5
3 3
4 4 Name 4
5 5 Name 3

Thanks in advance
Kim

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Find Last Occurrence of Number

Try it like this:

=IF(ISNA(LOOKUP(2,1/((Sheet3!A$1:A$5=A1)*(Sheet3!C$1:C$5="")))),"",LOO KUP(2,1/((Sheet3!A$1:A$5=A1)*(Sheet3!C$1:C$5="")),Sheet3!B $1:B$5))

--
Biff
Microsoft Excel MVP


"Joel" wrote in message
...
This is a little bit complicated. You need an IF so you don't get N/A
results when you don't return anything. The formula is in the lookup
function is in the equation twice to aviod the N/A.

The lookup array return something like this

=Lookup(2,1/{1,0,0,1,1,0,1},C1:C7)

=Lookup(2,{1,DIV 0,DIV 0,1,1,DIV 0,1},C1:C7)

The number two will never match anything exactly in the array. So instead
it returns the last 1 in the array which is the number smaller than 2.
The
DIV 0 is a very large number.


=IF(ISNA(LOOKUP(2,1/(--(Sheet3!$A$1:$A$100=A1)*--(Sheet3!$C$1:$C$100="")),Sheet3!$B$1:$B$100)),"",L OOKUP(2,1/(--(Sheet3!$A$1:$A$100=A1)*--(Sheet3!$C$1:$C$100="")),Sheet3!$B$1:$B$100))

"KimC" wrote:

Hi, I'm trying to work out how if I have the data (as seen below in
"Sheet
3"), how to use that to populate "Sheet 2" as shown.

I'm wanting to find the "name" in sheet 3 column B that is the last
occurrence of that value in column A that corresponds with the value in
sheet
2 column A as long as sheet 3 column C is blank.

Sheet 3
A B C
1 5 Name 1 12/01/2009
2 1 Name 2 10/01/2009
3 5 Name 3
4 4 Name 4
5 2 Name 5

Sheet 2
A B C
1 1
2 2 Name 5
3 3
4 4 Name 4
5 5 Name 3

Thanks in advance
Kim



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 52
Default Find Last Occurrence of Number

Thankyou to both of you - helped heaps :)

"T. Valko" wrote:

Try it like this:

=IF(ISNA(LOOKUP(2,1/((Sheet3!A$1:A$5=A1)*(Sheet3!C$1:C$5="")))),"",LOO KUP(2,1/((Sheet3!A$1:A$5=A1)*(Sheet3!C$1:C$5="")),Sheet3!B $1:B$5))

--
Biff
Microsoft Excel MVP


"Joel" wrote in message
...
This is a little bit complicated. You need an IF so you don't get N/A
results when you don't return anything. The formula is in the lookup
function is in the equation twice to aviod the N/A.

The lookup array return something like this

=Lookup(2,1/{1,0,0,1,1,0,1},C1:C7)

=Lookup(2,{1,DIV 0,DIV 0,1,1,DIV 0,1},C1:C7)

The number two will never match anything exactly in the array. So instead
it returns the last 1 in the array which is the number smaller than 2.
The
DIV 0 is a very large number.


=IF(ISNA(LOOKUP(2,1/(--(Sheet3!$A$1:$A$100=A1)*--(Sheet3!$C$1:$C$100="")),Sheet3!$B$1:$B$100)),"",L OOKUP(2,1/(--(Sheet3!$A$1:$A$100=A1)*--(Sheet3!$C$1:$C$100="")),Sheet3!$B$1:$B$100))

"KimC" wrote:

Hi, I'm trying to work out how if I have the data (as seen below in
"Sheet
3"), how to use that to populate "Sheet 2" as shown.

I'm wanting to find the "name" in sheet 3 column B that is the last
occurrence of that value in column A that corresponds with the value in
sheet
2 column A as long as sheet 3 column C is blank.

Sheet 3
A B C
1 5 Name 1 12/01/2009
2 1 Name 2 10/01/2009
3 5 Name 3
4 4 Name 4
5 2 Name 5

Sheet 2
A B C
1 1
2 2 Name 5
3 3
4 4 Name 4
5 5 Name 3

Thanks in advance
Kim




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
How to find out the 3 highest occurrence of number from a list? Eric Excel Discussion (Misc queries) 5 August 15th 07 04:40 PM
How to find SECOND occurrence in a string? Bill_S Excel Worksheet Functions 4 March 19th 07 06:49 PM
Index function to find nth occurrence Ken Excel Worksheet Functions 4 November 15th 06 06:35 PM
Find nth occurrence and replace with ":" marlea Excel Worksheet Functions 4 October 5th 05 10:43 PM
find last occurrence REMnLYN Excel Worksheet Functions 9 March 29th 05 10:43 AM


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