Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 2
Default Returning a value that hasn't already been found

Hi there,
I am trying to make a spreadsheet in which I need to be able to return multiple values corresponding to the same dates without repeating the first returned value again (If that makes sense!!). For example:
A (birthdates) B(people)
1 2/04/2012 Ash
2 3/04/2012 San
3 2/04/2012 Ong
4 5/04/2012 Joe
5 6/04/2012 Raj
6 2/04/2012 Sur
7 8/04/2012 Ryan

Say for example, out of the list I want to return all of the people with a birthday on the 2/04/2012. I can make a formula like:
'=VLOOKUP(A10,B2:C8, 2, FALSE)', where the cell range is B2:C8, A10 is the date (i.e. 2/04/2012) and the dates are located in column 2. It will return 'Ash' as having a birthday on the required date (which is great). However, I want to make a formula for the cell below this to give me the next person having a birthday on the 2/04/2012 (i.e. Ong), but not return 'Ash' again. And continue this process below Ong (i.e. Return Sur but not Ong or Ash).

I hope that makes sense and someone is able to help me out. I have been thinking about it for a while now, but I'm not super talented when it comes to excel forumlae!
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,045
Default Returning a value that hasn't already been found

On Wed, 22 Feb 2012 05:41:05 +0000, azlan270690 wrote:


Hi there,
I am trying to make a spreadsheet in which I need to be able to return
multiple values corresponding to the same dates without repeating the
first returned value again (If that makes sense!!). For example:
A (birthdates) B(people)
1 2/04/2012 Ash
2 3/04/2012 San
3 2/04/2012 Ong
4 5/04/2012 Joe
5 6/04/2012 Raj
6 2/04/2012 Sur
7 8/04/2012 Ryan

Say for example, out of the list I want to return all of the people with
a birthday on the 2/04/2012. I can make a formula like:
'=VLOOKUP(A10,B2:C8, 2, FALSE)', where the cell range is B2:C8, A10 is
the date (i.e. 2/04/2012) and the dates are located in column 2. It will
return 'Ash' as having a birthday on the required date (which is great).
However, I want to make a formula for the cell below this to give me the
next person having a birthday on the 2/04/2012 (i.e. Ong), but not
return 'Ash' again. And continue this process below Ong (i.e. Return Sur
but not Ong or Ash).

I hope that makes sense and someone is able to help me out. I have been
thinking about it for a while now, but I'm not super talented when it
comes to excel forumlae!
Thanks


A simple method would be use a filter rather than a formula. That could be semi-automated using a macro. Would that be acceptable?

If you need a formula, you could use the following:

This formula must be **array-entered**:

=IFERROR(INDEX(People,SMALL((Birthdates=$A$10)*
ROW(Birthdates),COUNTA(Birthdates)-COUNTIF(
Birthdates,$A$10)+ROWS($1:1))),"")

In the above, People is a NAME'd range that *includes* the list of People (including the label in the first row); likewise for Birthdates. (You could substitue absolute references for the names; e.g. $B$1:$B$8)
After entering the formula in some cell, fill down as far as required. The formula will adjust to return subsequent matches of the birthday.
----------------------------------------

To **array-enter** a formula, after entering
the formula into the cell or formula bar, hold down
<ctrl<shift while hitting <enter. If you did this
correctly, Excel will place braces {...} around the formula.


For versions of Excel prior to 2007:

=IF((COUNTA(Birthdates)-COUNTIF(Birthdates,$A$10)+
ROWS($1:1))COUNTA(Birthdates),"",INDEX(
People,SMALL((Birthdates=$A$10)*ROW(Birthdates),
COUNTA(Birthdates)-COUNTIF(Birthdates,$A$10)+ROWS($1:1))))
I
  #3   Report Post  
Junior Member
 
Posts: 2
Default

Thanks for your help Ron. Yeah unfortunately I am unable to use a filter function for the particular spreadsheet I am using. But the formula was exactly what I was after. Thanks again.
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,045
Default Returning a value that hasn't already been found

On Thu, 23 Feb 2012 09:27:17 +0000, azlan270690 wrote:


Thanks for your help Ron. Yeah unfortunately I am unable to use a filter
function for the particular spreadsheet I am using. But the formula was
exactly what I was after. Thanks again.


Glad to help. Thanks for the feedback.
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
Returning 0 instead of #N/A when no value is found RobertSD Excel Worksheet Functions 8 October 27th 08 11:43 PM
Returning an alternative value if lookup cannot be found in array Queen_Of_Thebes Excel Discussion (Misc queries) 4 September 2nd 08 01:43 AM
I found a bug Don Wiss Excel Programming 2 August 22nd 07 01:44 AM
IF NOT FOUND roy.okinawa Excel Worksheet Functions 5 November 17th 05 03:26 AM
not found Nathan[_4_] Excel Programming 1 June 25th 04 05:26 AM


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