Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
nsd nsd is offline
external usenet poster
 
Posts: 23
Default Max no. of times a text repeated

Hi,
I have a report that categorises the regions into different catergories for.
e.g.

Region Population Category Education Category Job Category
1 A B
A
2 B C
C
3 A A
A
4 B C
B
5 C B
A

I'm looking for a formula that will check the categories i.e. A, B or C and
give a result in the form of max appeared i.e. in case of Region 1, A appears
twice and in case of Region 4, B appears twice. Or else if all categories are
equal then the result populate the category in Population criteria i.e. in
Region 5 all A, B & C categories appears hence it gives me the result as C
that appears under Population criteria.

Please help and advise.
thanks, nsd
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Max no. of times a text repeated

It is not very cleaver but seems to work:
=IF(COUNTIF(B2:E2,"A")1,"A",IF(COUNTIF(B2:E2,"B") 1,"B",IF(COUNTIF(B1:E1,"C")1,"C",B2)))
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"nsd" wrote in message
...
Hi,
I have a report that categorises the regions into different catergories
for.
e.g.

Region Population Category Education Category Job
Category
1 A B
A
2 B C
C
3 A A
A
4 B C
B
5 C B
A

I'm looking for a formula that will check the categories i.e. A, B or C
and
give a result in the form of max appeared i.e. in case of Region 1, A
appears
twice and in case of Region 4, B appears twice. Or else if all categories
are
equal then the result populate the category in Population criteria i.e. in
Region 5 all A, B & C categories appears hence it gives me the result as C
that appears under Population criteria.

Please help and advise.
thanks, nsd



  #3   Report Post  
Posted to microsoft.public.excel.misc
nsd nsd is offline
external usenet poster
 
Posts: 23
Default Max no. of times a text repeated

Thanks a ton 'Sir' Bernard, it really worked.

I would also request if you can explain this formula to me.
Thanx,
nsd

"Bernard Liengme" wrote:

It is not very cleaver but seems to work:
=IF(COUNTIF(B2:E2,"A")1,"A",IF(COUNTIF(B2:E2,"B") 1,"B",IF(COUNTIF(B1:E1,"C")1,"C",B2)))
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"nsd" wrote in message
...
Hi,
I have a report that categorises the regions into different catergories
for.
e.g.

Region Population Category Education Category Job
Category
1 A B
A
2 B C
C
3 A A
A
4 B C
B
5 C B
A

I'm looking for a formula that will check the categories i.e. A, B or C
and
give a result in the form of max appeared i.e. in case of Region 1, A
appears
twice and in case of Region 4, B appears twice. Or else if all categories
are
equal then the result populate the category in Population criteria i.e. in
Region 5 all A, B & C categories appears hence it gives me the result as C
that appears under Population criteria.

Please help and advise.
thanks, nsd




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Max no. of times a text repeated

Suppose we had: =IF(COUNTIF(B2:E2,"A")1,"A","The answers is not A")
COUNTIF(B2:E2,"A") counts how may As
If the answers greater than 1 (2 or 3) then A's are in the majority as you
have only three categories
So we return A when this is true and "The answers is not A" otherwise

IF(COUNTIF(B2:E2,"A")1,"A",IF(COUNTIF(B2:E2,"B") 1,"B","The answer is not A
or B" ))
Now we look to see if A is there more than once, and if not then we see if
B is there more than once.

IF(COUNTIF(B2:E2,"A")1,"A",IF(COUNTIF(B2:E2,"B") 1,"B",IF(COUNTIF(B1:E1,"C")1,"C",B2)))
Finally we look for A, then B, then C and if it is none of these is the
majority then we return what ever is in column B

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"nsd" wrote in message
...
Thanks a ton 'Sir' Bernard, it really worked.

I would also request if you can explain this formula to me.
Thanx,
nsd

"Bernard Liengme" wrote:

It is not very cleaver but seems to work:
=IF(COUNTIF(B2:E2,"A")1,"A",IF(COUNTIF(B2:E2,"B") 1,"B",IF(COUNTIF(B1:E1,"C")1,"C",B2)))
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"nsd" wrote in message
...
Hi,
I have a report that categorises the regions into different catergories
for.
e.g.

Region Population Category Education Category Job
Category
1 A B
A
2 B C
C
3 A A
A
4 B C
B
5 C B
A

I'm looking for a formula that will check the categories i.e. A, B or C
and
give a result in the form of max appeared i.e. in case of Region 1, A
appears
twice and in case of Region 4, B appears twice. Or else if all
categories
are
equal then the result populate the category in Population criteria i.e.
in
Region 5 all A, B & C categories appears hence it gives me the result
as C
that appears under Population criteria.

Please help and advise.
thanks, nsd






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
Count of times a number is repeated by date? bjkeyt Excel Worksheet Functions 2 April 7th 08 09:30 PM
Inserting Data Repeated Times Dan Spracklin Excel Discussion (Misc queries) 1 November 10th 06 05:51 PM
Printing text in a repeated cell/row that is longer than repeated Valerie Dyet Excel Discussion (Misc queries) 1 February 13th 06 03:27 AM
Count No. of times Dates are repeated Mandeep Dhami Excel Discussion (Misc queries) 6 December 8th 05 02:55 AM
how do I count the number of times a word is repeated in a range? sol Excel Discussion (Misc queries) 3 July 14th 05 01:53 PM


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