Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default Identifying correct elements with Countif

Im trying to count the number of instances a specific entry appears and then
I want to display the instances it found in the database. My logic for the
count appears to be working ok but it is not identifying the correct items.


In O2, my formula reads: =IF(Query!B3="","",COUNTIF(ChemName,DRUGENTRY))

In O4, my array formula reads:
{=IF(ROWS(O$4:O4)<=O$2,INDEX(DRUGLIST,SMALL(IF(ISN UMBER(SEARCH(DRUGENTRY,DRUGLIST)),ROW(ChemName)),R OWS(O$4:O4))-MIN(ROW(ChemName))+1,2),"")}
I copied the formula down to the cells below.

One tab contains the data entry of: epoetin alfa

My database looks like the following:
Drug Name Chemical Name J code
Aranesp darbepoetin alfa J0882
Aranesp darbepoetin alfa J0881
Epogen epoetin alfa J0886
Epogen epoetin alfa J0885
Epogen epoetin alfa J2505
Neumega oprelvekin J2355
Neupogen filgrastim J1440

The result I get for the count is 3 (which is right). But the items
identified as the three it found a darbepoetin alfa (twice) and epoetin
alfa (once). I do not want to include the darbepoetin alfa (even though it
includes the search name. I just want to capture the epoetin alfa. I only
want to include exact matches to the data entry. Ive tried modifying my
formula in several different ways, but I still cant get it to come back with
the exact match. If you could steer me in the right direction, I would
appreciate it.

--
Lady
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Identifying correct elements with Countif

I only want to include exact matches to the data entry.

Replace:
ISNUMBER(SEARCH(DRUGENTRY,DRUGLIST))

With:
DRUGLIST=DRUGENTRY

--
Biff
Microsoft Excel MVP


"Lady Success" wrote in message
...
I'm trying to count the number of instances a specific entry appears and
then
I want to display the instances it found in the database. My logic for
the
count appears to be working ok - but it is not identifying the correct
items.


In O2, my formula reads: =IF(Query!B3="","",COUNTIF(ChemName,DRUGENTRY))

In O4, my array formula reads:
{=IF(ROWS(O$4:O4)<=O$2,INDEX(DRUGLIST,SMALL(IF(ISN UMBER(SEARCH(DRUGENTRY,DRUGLIST)),ROW(ChemName)),R OWS(O$4:O4))-MIN(ROW(ChemName))+1,2),"")}
I copied the formula down to the cells below.

One tab contains the data entry of: "epoetin alfa"

My database looks like the following:
Drug Name Chemical Name J code
Aranesp darbepoetin alfa J0882
Aranesp darbepoetin alfa J0881
Epogen epoetin alfa J0886
Epogen epoetin alfa J0885
Epogen epoetin alfa J2505
Neumega oprelvekin J2355
Neupogen filgrastim J1440

The result I get for the count is 3 (which is right). But the items
identified as the three it found a darbepoetin alfa (twice) and
epoetin
alfa (once). I do not want to include the darbepoetin alfa (even though
it
includes the search name. I just want to capture the epoetin alfa. I
only
want to include exact matches to the data entry. I've tried modifying my
formula in several different ways, but I still can't get it to come back
with
the exact match. If you could steer me in the right direction, I would
appreciate it.

--
Lady



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default Identifying correct elements with Countif

That worked well for the epoetin alfa scenario, but now when I enter
filgrastim as my data entry, it gives me #N/A error.... If I'm looking for
an exact match, why doesn't it work when there's just one word and not two?
--
Lady


"T. Valko" wrote:

I only want to include exact matches to the data entry.


Replace:
ISNUMBER(SEARCH(DRUGENTRY,DRUGLIST))

With:
DRUGLIST=DRUGENTRY

--
Biff
Microsoft Excel MVP


"Lady Success" wrote in message
...
I'm trying to count the number of instances a specific entry appears and
then
I want to display the instances it found in the database. My logic for
the
count appears to be working ok - but it is not identifying the correct
items.


In O2, my formula reads: =IF(Query!B3="","",COUNTIF(ChemName,DRUGENTRY))

In O4, my array formula reads:
{=IF(ROWS(O$4:O4)<=O$2,INDEX(DRUGLIST,SMALL(IF(ISN UMBER(SEARCH(DRUGENTRY,DRUGLIST)),ROW(ChemName)),R OWS(O$4:O4))-MIN(ROW(ChemName))+1,2),"")}
I copied the formula down to the cells below.

One tab contains the data entry of: "epoetin alfa"

My database looks like the following:
Drug Name Chemical Name J code
Aranesp darbepoetin alfa J0882
Aranesp darbepoetin alfa J0881
Epogen epoetin alfa J0886
Epogen epoetin alfa J0885
Epogen epoetin alfa J2505
Neumega oprelvekin J2355
Neupogen filgrastim J1440

The result I get for the count is 3 (which is right). But the items
identified as the three it found a darbepoetin alfa (twice) and
epoetin
alfa (once). I do not want to include the darbepoetin alfa (even though
it
includes the search name. I just want to capture the epoetin alfa. I
only
want to include exact matches to the data entry. I've tried modifying my
formula in several different ways, but I still can't get it to come back
with
the exact match. If you could steer me in the right direction, I would
appreciate it.

--
Lady




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Identifying correct elements with Countif

Could be unseen characters like spaces in either the DRUGENTRY or DRUGLIST
ranges:

filgrastim<space
<spacefilgrastim
<spacefilgrastim<space


--
Biff
Microsoft Excel MVP


"Lady Success" wrote in message
...
That worked well for the epoetin alfa scenario, but now when I enter
filgrastim as my data entry, it gives me #N/A error.... If I'm looking
for
an exact match, why doesn't it work when there's just one word and not
two?
--
Lady


"T. Valko" wrote:

I only want to include exact matches to the data entry.


Replace:
ISNUMBER(SEARCH(DRUGENTRY,DRUGLIST))

With:
DRUGLIST=DRUGENTRY

--
Biff
Microsoft Excel MVP


"Lady Success" wrote in message
...
I'm trying to count the number of instances a specific entry appears
and
then
I want to display the instances it found in the database. My logic for
the
count appears to be working ok - but it is not identifying the correct
items.


In O2, my formula reads:
=IF(Query!B3="","",COUNTIF(ChemName,DRUGENTRY))

In O4, my array formula reads:
{=IF(ROWS(O$4:O4)<=O$2,INDEX(DRUGLIST,SMALL(IF(ISN UMBER(SEARCH(DRUGENTRY,DRUGLIST)),ROW(ChemName)),R OWS(O$4:O4))-MIN(ROW(ChemName))+1,2),"")}
I copied the formula down to the cells below.

One tab contains the data entry of: "epoetin alfa"

My database looks like the following:
Drug Name Chemical Name J code
Aranesp darbepoetin alfa J0882
Aranesp darbepoetin alfa J0881
Epogen epoetin alfa J0886
Epogen epoetin alfa J0885
Epogen epoetin alfa J2505
Neumega oprelvekin J2355
Neupogen filgrastim J1440

The result I get for the count is 3 (which is right). But the items
identified as the three it found a darbepoetin alfa (twice) and
epoetin
alfa (once). I do not want to include the darbepoetin alfa (even
though
it
includes the search name. I just want to capture the epoetin alfa. I
only
want to include exact matches to the data entry. I've tried modifying
my
formula in several different ways, but I still can't get it to come
back
with
the exact match. If you could steer me in the right direction, I would
appreciate it.

--
Lady






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
Identifying correct row RCulli0322 Excel Discussion (Misc queries) 1 November 16th 08 05:05 PM
Elements Gallery ckane Excel Discussion (Misc queries) 0 October 3rd 08 05:35 PM
identifying colours of existing elements / series Boris Charts and Charting in Excel 0 August 27th 08 01:45 PM
Protection elements Eva Excel Discussion (Misc queries) 2 February 16th 07 09:58 AM
Complex countif of array elements Biff Excel Worksheet Functions 1 February 9th 06 08:52 PM


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