Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
carl
 
Posts: n/a
Default Identifying First Instance of a Value Given a Criteria



My data table is like this:

Date ID
20060403 123
20060403 456
20060403 789
20060403 123
20060403 222
20060403 222
20060404 123
20060404 888
20060404 777
20060404 222

I am using a formula like this in ColC

=COUNTIF($B$2:B2,B2)=1

to help ID first instance of a given ID

It gives a result like this:

Date ID
20060403 123 TRUE
20060403 456 TRUE
20060403 789 TRUE
20060403 123 FALSE
20060403 222 TRUE
20060403 222 FALSE
20060404 123 FALSE
20060404 888 TRUE
20060404 777 TRUE
20060404 222 FALSE


I would like to modify the formula to identify the first instance for each
day - some of the ID are re-used on a day-to-day basis.

A result like this is what I am targeting:

Date ID
20060403 123 TRUE
20060403 456 TRUE
20060403 789 TRUE
20060403 123 FALSE
20060403 222 TRUE
20060403 222 FALSE
20060404 123 TRUE
20060404 888 TRUE
20060404 777 TRUE
20060404 222 TRUE


Is this possible ?

Thank you in advance.



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Identifying First Instance of a Value Given a Criteria

=SUMPRODUCT(--($A$2:A2=A2),--($B$2:B2=B2))=1

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"carl" wrote in message
...


My data table is like this:

Date ID
20060403 123
20060403 456
20060403 789
20060403 123
20060403 222
20060403 222
20060404 123
20060404 888
20060404 777
20060404 222

I am using a formula like this in ColC

=COUNTIF($B$2:B2,B2)=1

to help ID first instance of a given ID

It gives a result like this:

Date ID
20060403 123 TRUE
20060403 456 TRUE
20060403 789 TRUE
20060403 123 FALSE
20060403 222 TRUE
20060403 222 FALSE
20060404 123 FALSE
20060404 888 TRUE
20060404 777 TRUE
20060404 222 FALSE


I would like to modify the formula to identify the first instance for each
day - some of the ID are re-used on a day-to-day basis.

A result like this is what I am targeting:

Date ID
20060403 123 TRUE
20060403 456 TRUE
20060403 789 TRUE
20060403 123 FALSE
20060403 222 TRUE
20060403 222 FALSE
20060404 123 TRUE
20060404 888 TRUE
20060404 777 TRUE
20060404 222 TRUE


Is this possible ?

Thank you in advance.





  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default Identifying First Instance of a Value Given a Criteria

=SUMPRODUCT(--($A$2:A2&$B$2:B2=A2&B2))=1

copy down


--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com



"carl" wrote in message
...


My data table is like this:

Date ID
20060403 123
20060403 456
20060403 789
20060403 123
20060403 222
20060403 222
20060404 123
20060404 888
20060404 777
20060404 222

I am using a formula like this in ColC

=COUNTIF($B$2:B2,B2)=1

to help ID first instance of a given ID

It gives a result like this:

Date ID
20060403 123 TRUE
20060403 456 TRUE
20060403 789 TRUE
20060403 123 FALSE
20060403 222 TRUE
20060403 222 FALSE
20060404 123 FALSE
20060404 888 TRUE
20060404 777 TRUE
20060404 222 FALSE


I would like to modify the formula to identify the first instance for each
day - some of the ID are re-used on a day-to-day basis.

A result like this is what I am targeting:

Date ID
20060403 123 TRUE
20060403 456 TRUE
20060403 789 TRUE
20060403 123 FALSE
20060403 222 TRUE
20060403 222 FALSE
20060404 123 TRUE
20060404 888 TRUE
20060404 777 TRUE
20060404 222 TRUE


Is this possible ?

Thank you in advance.





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
Getting Excel MDI/SDI/Excel Instance to behave more logically mswlogo Setting up and Configuration of Excel 2 April 23rd 23 11:43 AM
Total Summed Count of Numeric Repeat (Paired /Double Instance) Criteria Sam via OfficeKB.com Excel Worksheet Functions 2 March 20th 06 02:29 AM
Returning Results Based on Two Criteria [email protected] Excel Worksheet Functions 7 October 23rd 05 02:53 PM
sorting more than 3 keys Brooke Excel Discussion (Misc queries) 3 June 18th 05 04:52 AM
SUMPRODUCT Formula to Count Row of data Below Matched Criteria Sam via OfficeKB.com Excel Worksheet Functions 8 February 3rd 05 01:37 AM


All times are GMT +1. The time now is 06:53 PM.

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"