Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Lookup Exact functions in formula?

Hi, am trying to work out a formula, would really appreciate some help though -
a simplified example of my data -

A B
code name
1 MG1 abc
2 MG2 d
3 MG3 e
4 MG1 f
5 MG5 g
6 MG6 h
7 MG1 a
8 MG8 j
9 MG9 abc
10 MG10 a

where "abc" name refers to a group which includes the names "a","b" and "c"
I have a COUNTIF formula for counting the number of times certain names, say
"abc","d","e" and "a", occur [=5 above]

I would like to subtract the number of times "a","b" or "c" occur when their
code is the same as the code for any "abc", as they would already be
represented by that name, answer=1 above [row 1 "abc" and row 7 "a" both
contain "a" and have the same code, whereas row 10 "a" has a different code
so doesnt need to be subtracted]

I can't work out how to write a formula for this subtraction, maybe it is
too difficult. I think the formula needs to search for specific names[values]
and lookup exact matching codes for those names. Any help would be great, Roge

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,718
Default Lookup Exact functions in formula?

=SUM(N(FREQUENCY(IF(ISNUMBER(MATCH(Name,{"abc","d" ,"e","a"},)),MATCH(Code,Code,)),MATCH(Code,Code,)) 0))

ctrl+shift+enter, not just enter


"Roge" wrote:

Hi, am trying to work out a formula, would really appreciate some help though -
a simplified example of my data -

A B
code name
1 MG1 abc
2 MG2 d
3 MG3 e
4 MG1 f
5 MG5 g
6 MG6 h
7 MG1 a
8 MG8 j
9 MG9 abc
10 MG10 a

where "abc" name refers to a group which includes the names "a","b" and "c"
I have a COUNTIF formula for counting the number of times certain names, say
"abc","d","e" and "a", occur [=5 above]

I would like to subtract the number of times "a","b" or "c" occur when their
code is the same as the code for any "abc", as they would already be
represented by that name, answer=1 above [row 1 "abc" and row 7 "a" both
contain "a" and have the same code, whereas row 10 "a" has a different code
so doesnt need to be subtracted]

I can't work out how to write a formula for this subtraction, maybe it is
too difficult. I think the formula needs to search for specific names[values]
and lookup exact matching codes for those names. Any help would be great, Roge

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default Lookup Exact functions in formula?

Hi,

Based on your example you want to subtract a "c" entry from the number of
entries that contain "a", "d", "e" or "abc" if they have the same code. Well
suppose that there are 5 entries that are either "a", "d", "e" or "abc" and
there are 6 enties with just "c" then you get a negative 1 if they all have
the same code. Is this what you really want? That is not what the suggested
formula will return, although I suspect that it may return what you really
want.

Also to use the supplied formula as written you must name the ranges where
your codes and names are.

--
Thanks,
Shane Devenshire


"Roge" wrote:

Hi, am trying to work out a formula, would really appreciate some help though -
a simplified example of my data -

A B
code name
1 MG1 abc
2 MG2 d
3 MG3 e
4 MG1 f
5 MG5 g
6 MG6 h
7 MG1 a
8 MG8 j
9 MG9 abc
10 MG10 a

where "abc" name refers to a group which includes the names "a","b" and "c"
I have a COUNTIF formula for counting the number of times certain names, say
"abc","d","e" and "a", occur [=5 above]

I would like to subtract the number of times "a","b" or "c" occur when their
code is the same as the code for any "abc", as they would already be
represented by that name, answer=1 above [row 1 "abc" and row 7 "a" both
contain "a" and have the same code, whereas row 10 "a" has a different code
so doesnt need to be subtracted]

I can't work out how to write a formula for this subtraction, maybe it is
too difficult. I think the formula needs to search for specific names[values]
and lookup exact matching codes for those names. Any help would be great, Roge

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Lookup Exact functions in formula?

Hi, thanks for the replies,

I would like to subtract the number of times "a","b" or "c" occur when their
code is the same as the code for any "abc" [rather than what you suggest
'subtract a "c" entry from the number of entries that contain "a", "d", "e"
or "abc"']

As "abc" name refers to a group name which includes the names "a","b" and
"c", so am trying to account for this, when I add up the number of specific
names. The anwer shouldnt be negative as there will only be a few "abc"
group names within my data.

In my example the answer=1, as row 1 "abc" and row 7 "a" both
contain "a" and have the same code, whereas row 10 "a" has a different code
so doesnt need to be subtracted.

This is seems quite complicated, not sure if the suggested formula is
matching the names I mention above or how to name the ranges where codes and
names are, thanks again for the help, Roge

"ShaneDevenshire" wrote:

Hi,

Based on your example you want to subtract a "c" entry from the number of
entries that contain "a", "d", "e" or "abc" if they have the same code. Well
suppose that there are 5 entries that are either "a", "d", "e" or "abc" and
there are 6 enties with just "c" then you get a negative 1 if they all have
the same code. Is this what you really want? That is not what the suggested
formula will return, although I suspect that it may return what you really
want.

Also to use the supplied formula as written you must name the ranges where
your codes and names are.

--
Thanks,
Shane Devenshire


"Roge" wrote:

Hi, am trying to work out a formula, would really appreciate some help though -
a simplified example of my data -

A B
code name
1 MG1 abc
2 MG2 d
3 MG3 e
4 MG1 f
5 MG5 g
6 MG6 h
7 MG1 a
8 MG8 j
9 MG9 abc
10 MG10 a

where "abc" name refers to a group which includes the names "a","b" and "c"
I have a COUNTIF formula for counting the number of times certain names, say
"abc","d","e" and "a", occur [=5 above]

I would like to subtract the number of times "a","b" or "c" occur when their
code is the same as the code for any "abc", as they would already be
represented by that name, answer=1 above [row 1 "abc" and row 7 "a" both
contain "a" and have the same code, whereas row 10 "a" has a different code
so doesnt need to be subtracted]

I can't work out how to write a formula for this subtraction, maybe it is
too difficult. I think the formula needs to search for specific names[values]
and lookup exact matching codes for those names. Any help would be great, Roge

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Lookup Exact functions in formula?

I *think* this does what you want.

Array entered**:

=SUM(--(FREQUENCY(IF((COUNTIF(Code,Code)1)*(ISNUMBER(SEA RCH(Name,"abc"))),MATCH(Code,Code,0)),ROW(Code)-MIN(ROW(Code))+1)0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"Roge" wrote in message
...
Hi, thanks for the replies,

I would like to subtract the number of times "a","b" or "c" occur when
their
code is the same as the code for any "abc" [rather than what you suggest
'subtract a "c" entry from the number of entries that contain "a", "d",
"e"
or "abc"']

As "abc" name refers to a group name which includes the names "a","b" and
"c", so am trying to account for this, when I add up the number of
specific
names. The anwer shouldnt be negative as there will only be a few "abc"
group names within my data.

In my example the answer=1, as row 1 "abc" and row 7 "a" both
contain "a" and have the same code, whereas row 10 "a" has a different
code
so doesnt need to be subtracted.

This is seems quite complicated, not sure if the suggested formula is
matching the names I mention above or how to name the ranges where codes
and
names are, thanks again for the help, Roge

"ShaneDevenshire" wrote:

Hi,

Based on your example you want to subtract a "c" entry from the number of
entries that contain "a", "d", "e" or "abc" if they have the same code.
Well
suppose that there are 5 entries that are either "a", "d", "e" or "abc"
and
there are 6 enties with just "c" then you get a negative 1 if they all
have
the same code. Is this what you really want? That is not what the
suggested
formula will return, although I suspect that it may return what you
really
want.

Also to use the supplied formula as written you must name the ranges
where
your codes and names are.

--
Thanks,
Shane Devenshire


"Roge" wrote:

Hi, am trying to work out a formula, would really appreciate some help
though -
a simplified example of my data -

A B
code name
1 MG1 abc
2 MG2 d
3 MG3 e
4 MG1 f
5 MG5 g
6 MG6 h
7 MG1 a
8 MG8 j
9 MG9 abc
10 MG10 a

where "abc" name refers to a group which includes the names "a","b" and
"c"
I have a COUNTIF formula for counting the number of times certain
names, say
"abc","d","e" and "a", occur [=5 above]

I would like to subtract the number of times "a","b" or "c" occur when
their
code is the same as the code for any "abc", as they would already be
represented by that name, answer=1 above [row 1 "abc" and row 7 "a"
both
contain "a" and have the same code, whereas row 10 "a" has a different
code
so doesnt need to be subtracted]

I can't work out how to write a formula for this subtraction, maybe it
is
too difficult. I think the formula needs to search for specific
names[values]
and lookup exact matching codes for those names. Any help would be
great, Roge



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
Find exact value using LOOKUP kawfeehaus Excel Discussion (Misc queries) 8 November 3rd 09 03:27 AM
Lookup Exact functions? Roge New Users to Excel 6 September 28th 08 01:11 PM
Need to do an EXACT LOOKUP archsmooth Excel Worksheet Functions 1 June 4th 07 06:16 PM
LookUp - Exact only Desparate Excel Worksheet Functions 2 November 11th 04 09:52 AM
LookUp - Exact only Desparate Excel Worksheet Functions 1 November 11th 04 09:45 AM


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