Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 60
Default Determining the text mode from a variety of data types

Dear Forum,

I would be very grateful if anyone can provide a solution to the following
problem;

I have a dataset as per the example below that consists of text and numbers.
I am trying to determine the mode based on the text entries and not the
number entries. In the example below the entry "ear infection" would
represent the text mode as it appears the most amount of times. The number
values represent sub totals.

Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3


Many Thanks
Matt
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Determining the text mode from a variety of data types

So what is it that you want to end up with?

Pete

On Jul 30, 3:31*pm, matt3542
wrote:
Dear Forum,

I would be very grateful if anyone can provide a solution to the following
problem;

I have a dataset as per the example below that consists of text and numbers.
I am trying to determine the mode based on the text entries and not the
number entries. In the example below the entry "ear infection" would
represent the text mode as it appears the most amount of times. The number
values represent sub totals.

Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3

Many Thanks
Matt


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 60
Default Determining the text mode from a variety of data types

Hi Pete, ideally the value returned would be "Ear Infection" as this is the
text string that appears the most.

Thanks
Matt

"Pete_UK" wrote:

So what is it that you want to end up with?

Pete

On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,

I would be very grateful if anyone can provide a solution to the following
problem;

I have a dataset as per the example below that consists of text and numbers.
I am trying to determine the mode based on the text entries and not the
number entries. In the example below the entry "ear infection" would
represent the text mode as it appears the most amount of times. The number
values represent sub totals.

Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3

Many Thanks
Matt



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Determining the text mode from a variety of data types

Try this - works for text and/or numbers:

=INDEX(A1:A10,MODE(MATCH(A1:A10&"",A1:A10&"",0)))

This formula counts empty cells as zero, so if you sized the range where
empty rows outnumbered those with values, you'd get a 0 return.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"matt3542" wrote in message
...
Hi Pete, ideally the value returned would be "Ear Infection" as this is the
text string that appears the most.

Thanks
Matt

"Pete_UK" wrote:

So what is it that you want to end up with?

Pete

On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,

I would be very grateful if anyone can provide a solution to the
following
problem;

I have a dataset as per the example below that consists of text and
numbers.
I am trying to determine the mode based on the text entries and not the
number entries. In the example below the entry "ear infection" would
represent the text mode as it appears the most amount of times. The
number
values represent sub totals.

Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3

Many Thanks
Matt





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Determining the text mode from a variety of data types

Ah, that kind of mode !!

One way (off the top of my head). Copy that column to another sheet,
ensure you have a header in A1 (insert a new row at the top if
necessary and type a word in A1), then sort the data, so that your
numbers are bunched at the top (and you can easily delete the rows
with them in) such that you are left just with the text entries.
Highlight all the data, including the header, and click on Data |
Filter | Advanced Filter. Your range should already be identified, but
you want to choose Unique records only and Copy to another location -
put in C1 as the destination and click OK. Now you can delete columns
A and B, leaving you with a unique list in alphabetical order in
column A. In B2 you can enter this formula:

=COUNTIF(Sheet1!A:A,A2)

then copy this down, to give you a count of each of the text values in
the other sheet. From here you can easily use the MODE function to
find the most common.

Hope this helps.

Pete

On Jul 30, 3:51*pm, matt3542
wrote:
Hi Pete, ideally the value returned would be "Ear Infection" as this is the
text string that appears the most.

Thanks
Matt



"Pete_UK" wrote:
So what is it that you want to end up with?


Pete


On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,


I would be very grateful if anyone can provide a solution to the following
problem;


I have a dataset as per the example below that consists of text and numbers.
I am trying to determine the mode based on the text entries and not the
number entries. In the example below the entry "ear infection" would
represent the text mode as it appears the most amount of times. The number
values represent sub totals.


Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3


Many Thanks
Matt- Hide quoted text -


- Show quoted text -




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Determining the text mode from a variety of data types

Sorry, at the end you would use MAX to find the largest, and then use
INDEX/MATCH to return the string, but I see tht RD has given you a
better solution.

Pete

On Jul 30, 4:18*pm, Pete_UK wrote:
Ah, that kind of mode !!

One way (off the top of my head). Copy that column to another sheet,
ensure you have a header in A1 (insert a new row at the top if
necessary and type a word in A1), then sort the data, so that your
numbers are bunched at the top (and you can easily delete the rows
with them in) such that you are left just with the text entries.
Highlight all the data, including the header, and click on Data |
Filter | Advanced Filter. Your range should already be identified, but
you want to choose Unique records only and Copy to another location -
put in C1 as the destination and click OK. Now you can delete columns
A and B, leaving you with a unique list in alphabetical order in
column A. In B2 you can enter this formula:

=COUNTIF(Sheet1!A:A,A2)

then copy this down, to give you a count of each of the text values in
the other sheet. From here you can easily use the MODE function to
find the most common.

Hope this helps.

Pete

On Jul 30, 3:51*pm, matt3542
wrote:



Hi Pete, ideally the value returned would be "Ear Infection" as this is the
text string that appears the most.


Thanks
Matt


"Pete_UK" wrote:
So what is it that you want to end up with?


Pete


On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,


I would be very grateful if anyone can provide a solution to the following
problem;


I have a dataset as per the example below that consists of text and numbers.
I am trying to determine the mode based on the text entries and not the
number entries. In the example below the entry "ear infection" would
represent the text mode as it appears the most amount of times. The number
values represent sub totals.


Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3


Many Thanks
Matt- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 60
Default Determining the text mode from a variety of data types

Hi RagDyeR,

Thanks for the reply. Unfortunately it is returning 0 as the result -
apologies I should of added that there are more empty cells than completed
cells, i.e

a1 blank
a2 blank
a3 blank
a4 3
a5 cat
a6 cat
a7 blank

Ideally the expected text string mode would be "cat" but as per the above it
is returning 0. Please can you advise if there is a way around this?

Thanks
Matt

"RagDyeR" wrote:

Try this - works for text and/or numbers:

=INDEX(A1:A10,MODE(MATCH(A1:A10&"",A1:A10&"",0)))

This formula counts empty cells as zero, so if you sized the range where
empty rows outnumbered those with values, you'd get a 0 return.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"matt3542" wrote in message
...
Hi Pete, ideally the value returned would be "Ear Infection" as this is the
text string that appears the most.

Thanks
Matt

"Pete_UK" wrote:

So what is it that you want to end up with?

Pete

On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,

I would be very grateful if anyone can provide a solution to the
following
problem;

I have a dataset as per the example below that consists of text and
numbers.
I am trying to determine the mode based on the text entries and not the
number entries. In the example below the entry "ear infection" would
represent the text mode as it appears the most amount of times. The
number
values represent sub totals.

Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3

Many Thanks
Matt






  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 60
Default Determining the text mode from a variety of data types

Hi Pete, thanks for spending the time helping out, that worked perfectly,
many thanks, Matt

"Pete_UK" wrote:

Ah, that kind of mode !!

One way (off the top of my head). Copy that column to another sheet,
ensure you have a header in A1 (insert a new row at the top if
necessary and type a word in A1), then sort the data, so that your
numbers are bunched at the top (and you can easily delete the rows
with them in) such that you are left just with the text entries.
Highlight all the data, including the header, and click on Data |
Filter | Advanced Filter. Your range should already be identified, but
you want to choose Unique records only and Copy to another location -
put in C1 as the destination and click OK. Now you can delete columns
A and B, leaving you with a unique list in alphabetical order in
column A. In B2 you can enter this formula:

=COUNTIF(Sheet1!A:A,A2)

then copy this down, to give you a count of each of the text values in
the other sheet. From here you can easily use the MODE function to
find the most common.

Hope this helps.

Pete

On Jul 30, 3:51 pm, matt3542
wrote:
Hi Pete, ideally the value returned would be "Ear Infection" as this is the
text string that appears the most.

Thanks
Matt



"Pete_UK" wrote:
So what is it that you want to end up with?


Pete


On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,


I would be very grateful if anyone can provide a solution to the following
problem;


I have a dataset as per the example below that consists of text and numbers.
I am trying to determine the mode based on the text entries and not the
number entries. In the example below the entry "ear infection" would
represent the text mode as it appears the most amount of times. The number
values represent sub totals.


Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3


Many Thanks
Matt- Hide quoted text -


- Show quoted text -



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 60
Default Determining the text mode from a variety of data types

thanks again, appreciated

"Pete_UK" wrote:

Sorry, at the end you would use MAX to find the largest, and then use
INDEX/MATCH to return the string, but I see tht RD has given you a
better solution.

Pete

On Jul 30, 4:18 pm, Pete_UK wrote:
Ah, that kind of mode !!

One way (off the top of my head). Copy that column to another sheet,
ensure you have a header in A1 (insert a new row at the top if
necessary and type a word in A1), then sort the data, so that your
numbers are bunched at the top (and you can easily delete the rows
with them in) such that you are left just with the text entries.
Highlight all the data, including the header, and click on Data |
Filter | Advanced Filter. Your range should already be identified, but
you want to choose Unique records only and Copy to another location -
put in C1 as the destination and click OK. Now you can delete columns
A and B, leaving you with a unique list in alphabetical order in
column A. In B2 you can enter this formula:

=COUNTIF(Sheet1!A:A,A2)

then copy this down, to give you a count of each of the text values in
the other sheet. From here you can easily use the MODE function to
find the most common.

Hope this helps.

Pete

On Jul 30, 3:51 pm, matt3542
wrote:



Hi Pete, ideally the value returned would be "Ear Infection" as this is the
text string that appears the most.


Thanks
Matt


"Pete_UK" wrote:
So what is it that you want to end up with?


Pete


On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,


I would be very grateful if anyone can provide a solution to the following
problem;


I have a dataset as per the example below that consists of text and numbers.
I am trying to determine the mode based on the text entries and not the
number entries. In the example below the entry "ear infection" would
represent the text mode as it appears the most amount of times. The number
values represent sub totals.


Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3


Many Thanks
Matt- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Determining the text mode from a variety of data types

You're welcome, Matt - thanks for feeding back (both times !!).

Pete

On Jul 30, 5:18*pm, matt3542
wrote:
Hi Pete, thanks for spending the time helping out, that worked perfectly,
many thanks, Matt



  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Determining the text mode from a variety of data types

Assuming that your "blank" cells are *empty* cells.

Try this array formula** :

=INDEX(rng,MODE(IF(ISTEXT(rng),MATCH(rng,rng,0))))

If there isn't a "mode" then the formula returns #N/A.

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


--
Biff
Microsoft Excel MVP


"matt3542" wrote in message
...
Hi RagDyeR,

Thanks for the reply. Unfortunately it is returning 0 as the result -
apologies I should of added that there are more empty cells than completed
cells, i.e

a1 blank
a2 blank
a3 blank
a4 3
a5 cat
a6 cat
a7 blank

Ideally the expected text string mode would be "cat" but as per the above
it
is returning 0. Please can you advise if there is a way around this?

Thanks
Matt

"RagDyeR" wrote:

Try this - works for text and/or numbers:

=INDEX(A1:A10,MODE(MATCH(A1:A10&"",A1:A10&"",0)))

This formula counts empty cells as zero, so if you sized the range where
empty rows outnumbered those with values, you'd get a 0 return.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"matt3542" wrote in message
...
Hi Pete, ideally the value returned would be "Ear Infection" as this is
the
text string that appears the most.

Thanks
Matt

"Pete_UK" wrote:

So what is it that you want to end up with?

Pete

On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,

I would be very grateful if anyone can provide a solution to the
following
problem;

I have a dataset as per the example below that consists of text and
numbers.
I am trying to determine the mode based on the text entries and not
the
number entries. In the example below the entry "ear infection" would
represent the text mode as it appears the most amount of times. The
number
values represent sub totals.

Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3

Many Thanks
Matt







  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Determining the text mode from a variety of data types

Try this *array* formula which will still work for numbers and/or text, and
will by-pass blank cells:

=INDEX(A1:A10,MODE(IF(A1:A10<"",MATCH(A1:A10,A1:A 10,0))))
--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter, instead of
the regular <Enter, which will *automatically* enclose the formula in curly
brackets, which *cannot* be done manually. Also, you must use CSE when
revising the formula.

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"matt3542" wrote in message
...
Hi RagDyeR,

Thanks for the reply. Unfortunately it is returning 0 as the result -
apologies I should of added that there are more empty cells than completed
cells, i.e

a1 blank
a2 blank
a3 blank
a4 3
a5 cat
a6 cat
a7 blank

Ideally the expected text string mode would be "cat" but as per the above
it
is returning 0. Please can you advise if there is a way around this?

Thanks
Matt

"RagDyeR" wrote:

Try this - works for text and/or numbers:

=INDEX(A1:A10,MODE(MATCH(A1:A10&"",A1:A10&"",0)))

This formula counts empty cells as zero, so if you sized the range where
empty rows outnumbered those with values, you'd get a 0 return.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"matt3542" wrote in message
...
Hi Pete, ideally the value returned would be "Ear Infection" as this is
the
text string that appears the most.

Thanks
Matt

"Pete_UK" wrote:

So what is it that you want to end up with?

Pete

On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,

I would be very grateful if anyone can provide a solution to the
following
problem;

I have a dataset as per the example below that consists of text and
numbers.
I am trying to determine the mode based on the text entries and not
the
number entries. In the example below the entry "ear infection" would
represent the text mode as it appears the most amount of times. The
number
values represent sub totals.

Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3

Many Thanks
Matt







  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 60
Default Determining the text mode from a variety of data types

Many thanks Biff, thats clever stuff, worked just right, I would have never
of come with that!

Cheers
Matt

"T. Valko" wrote:

Assuming that your "blank" cells are *empty* cells.

Try this array formula** :

=INDEX(rng,MODE(IF(ISTEXT(rng),MATCH(rng,rng,0))))

If there isn't a "mode" then the formula returns #N/A.

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


--
Biff
Microsoft Excel MVP


"matt3542" wrote in message
...
Hi RagDyeR,

Thanks for the reply. Unfortunately it is returning 0 as the result -
apologies I should of added that there are more empty cells than completed
cells, i.e

a1 blank
a2 blank
a3 blank
a4 3
a5 cat
a6 cat
a7 blank

Ideally the expected text string mode would be "cat" but as per the above
it
is returning 0. Please can you advise if there is a way around this?

Thanks
Matt

"RagDyeR" wrote:

Try this - works for text and/or numbers:

=INDEX(A1:A10,MODE(MATCH(A1:A10&"",A1:A10&"",0)))

This formula counts empty cells as zero, so if you sized the range where
empty rows outnumbered those with values, you'd get a 0 return.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"matt3542" wrote in message
...
Hi Pete, ideally the value returned would be "Ear Infection" as this is
the
text string that appears the most.

Thanks
Matt

"Pete_UK" wrote:

So what is it that you want to end up with?

Pete

On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,

I would be very grateful if anyone can provide a solution to the
following
problem;

I have a dataset as per the example below that consists of text and
numbers.
I am trying to determine the mode based on the text entries and not
the
number entries. In the example below the entry "ear infection" would
represent the text mode as it appears the most amount of times. The
number
values represent sub totals.

Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3

Many Thanks
Matt








  #14   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 60
Default Determining the text mode from a variety of data types

Hi RagDyer, thanks for taking the time to devise something different but
unfortunately it is now returning the mode as a numeric value. Biff has
offered an answer which seems to work ok, cheers, matt

"RagDyer" wrote:

Try this *array* formula which will still work for numbers and/or text, and
will by-pass blank cells:

=INDEX(A1:A10,MODE(IF(A1:A10<"",MATCH(A1:A10,A1:A 10,0))))
--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter, instead of
the regular <Enter, which will *automatically* enclose the formula in curly
brackets, which *cannot* be done manually. Also, you must use CSE when
revising the formula.

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"matt3542" wrote in message
...
Hi RagDyeR,

Thanks for the reply. Unfortunately it is returning 0 as the result -
apologies I should of added that there are more empty cells than completed
cells, i.e

a1 blank
a2 blank
a3 blank
a4 3
a5 cat
a6 cat
a7 blank

Ideally the expected text string mode would be "cat" but as per the above
it
is returning 0. Please can you advise if there is a way around this?

Thanks
Matt

"RagDyeR" wrote:

Try this - works for text and/or numbers:

=INDEX(A1:A10,MODE(MATCH(A1:A10&"",A1:A10&"",0)))

This formula counts empty cells as zero, so if you sized the range where
empty rows outnumbered those with values, you'd get a 0 return.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"matt3542" wrote in message
...
Hi Pete, ideally the value returned would be "Ear Infection" as this is
the
text string that appears the most.

Thanks
Matt

"Pete_UK" wrote:

So what is it that you want to end up with?

Pete

On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,

I would be very grateful if anyone can provide a solution to the
following
problem;

I have a dataset as per the example below that consists of text and
numbers.
I am trying to determine the mode based on the text entries and not
the
number entries. In the example below the entry "ear infection" would
represent the text mode as it appears the most amount of times. The
number
values represent sub totals.

Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3

Many Thanks
Matt








  #15   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Determining the text mode from a variety of data types

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"matt3542" wrote in message
...
Many thanks Biff, thats clever stuff, worked just right, I would have
never
of come with that!

Cheers
Matt

"T. Valko" wrote:

Assuming that your "blank" cells are *empty* cells.

Try this array formula** :

=INDEX(rng,MODE(IF(ISTEXT(rng),MATCH(rng,rng,0))))

If there isn't a "mode" then the formula returns #N/A.

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


--
Biff
Microsoft Excel MVP


"matt3542" wrote in message
...
Hi RagDyeR,

Thanks for the reply. Unfortunately it is returning 0 as the result -
apologies I should of added that there are more empty cells than
completed
cells, i.e

a1 blank
a2 blank
a3 blank
a4 3
a5 cat
a6 cat
a7 blank

Ideally the expected text string mode would be "cat" but as per the
above
it
is returning 0. Please can you advise if there is a way around this?

Thanks
Matt

"RagDyeR" wrote:

Try this - works for text and/or numbers:

=INDEX(A1:A10,MODE(MATCH(A1:A10&"",A1:A10&"",0)))

This formula counts empty cells as zero, so if you sized the range
where
empty rows outnumbered those with values, you'd get a 0 return.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"matt3542" wrote in message
...
Hi Pete, ideally the value returned would be "Ear Infection" as this
is
the
text string that appears the most.

Thanks
Matt

"Pete_UK" wrote:

So what is it that you want to end up with?

Pete

On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,

I would be very grateful if anyone can provide a solution to the
following
problem;

I have a dataset as per the example below that consists of text
and
numbers.
I am trying to determine the mode based on the text entries and
not
the
number entries. In the example below the entry "ear infection"
would
represent the text mode as it appears the most amount of times.
The
number
values represent sub totals.

Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3

Many Thanks
Matt












  #16   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Determining the text mode from a variety of data types

There's nothing wrong with the formula!

It *will* return either a number or a text value, whichever is the largest
presence in the referenced array.

Did you copy it right from my post?
--

Regards,

RD
-----------------------------------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit !
-----------------------------------------------------------------------------------------------

"matt3542" wrote in message
...
Hi RagDyer, thanks for taking the time to devise something different but
unfortunately it is now returning the mode as a numeric value. Biff has
offered an answer which seems to work ok, cheers, matt

"RagDyer" wrote:

Try this *array* formula which will still work for numbers and/or text,
and
will by-pass blank cells:

=INDEX(A1:A10,MODE(IF(A1:A10<"",MATCH(A1:A10,A1:A 10,0))))
--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter, instead
of
the regular <Enter, which will *automatically* enclose the formula in
curly
brackets, which *cannot* be done manually. Also, you must use CSE when
revising the formula.

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"matt3542" wrote in message
...
Hi RagDyeR,

Thanks for the reply. Unfortunately it is returning 0 as the result -
apologies I should of added that there are more empty cells than
completed
cells, i.e

a1 blank
a2 blank
a3 blank
a4 3
a5 cat
a6 cat
a7 blank

Ideally the expected text string mode would be "cat" but as per the
above
it
is returning 0. Please can you advise if there is a way around this?

Thanks
Matt

"RagDyeR" wrote:

Try this - works for text and/or numbers:

=INDEX(A1:A10,MODE(MATCH(A1:A10&"",A1:A10&"",0)))

This formula counts empty cells as zero, so if you sized the range
where
empty rows outnumbered those with values, you'd get a 0 return.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"matt3542" wrote in message
...
Hi Pete, ideally the value returned would be "Ear Infection" as this is
the
text string that appears the most.

Thanks
Matt

"Pete_UK" wrote:

So what is it that you want to end up with?

Pete

On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,

I would be very grateful if anyone can provide a solution to the
following
problem;

I have a dataset as per the example below that consists of text and
numbers.
I am trying to determine the mode based on the text entries and not
the
number entries. In the example below the entry "ear infection"
would
represent the text mode as it appears the most amount of times. The
number
values represent sub totals.

Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3

Many Thanks
Matt










  #17   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Determining the text mode from a variety of data types

They wanted to *ignore* the numbers and return only the *text* mode.

--
Biff
Microsoft Excel MVP


"RagDyeR" wrote in message
...
There's nothing wrong with the formula!

It *will* return either a number or a text value, whichever is the largest
presence in the referenced array.

Did you copy it right from my post?
--

Regards,

RD
-----------------------------------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit !
-----------------------------------------------------------------------------------------------

"matt3542" wrote in message
...
Hi RagDyer, thanks for taking the time to devise something different but
unfortunately it is now returning the mode as a numeric value. Biff has
offered an answer which seems to work ok, cheers, matt

"RagDyer" wrote:

Try this *array* formula which will still work for numbers and/or text,
and
will by-pass blank cells:

=INDEX(A1:A10,MODE(IF(A1:A10<"",MATCH(A1:A10,A1:A 10,0))))
--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter, instead
of
the regular <Enter, which will *automatically* enclose the formula in
curly
brackets, which *cannot* be done manually. Also, you must use CSE when
revising the formula.

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"matt3542" wrote in message
...
Hi RagDyeR,

Thanks for the reply. Unfortunately it is returning 0 as the result -
apologies I should of added that there are more empty cells than
completed
cells, i.e

a1 blank
a2 blank
a3 blank
a4 3
a5 cat
a6 cat
a7 blank

Ideally the expected text string mode would be "cat" but as per the
above
it
is returning 0. Please can you advise if there is a way around this?

Thanks
Matt

"RagDyeR" wrote:

Try this - works for text and/or numbers:

=INDEX(A1:A10,MODE(MATCH(A1:A10&"",A1:A10&"",0)))

This formula counts empty cells as zero, so if you sized the range
where
empty rows outnumbered those with values, you'd get a 0 return.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"matt3542" wrote in message
...
Hi Pete, ideally the value returned would be "Ear Infection" as this
is
the
text string that appears the most.

Thanks
Matt

"Pete_UK" wrote:

So what is it that you want to end up with?

Pete

On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,

I would be very grateful if anyone can provide a solution to the
following
problem;

I have a dataset as per the example below that consists of text
and
numbers.
I am trying to determine the mode based on the text entries and
not
the
number entries. In the example below the entry "ear infection"
would
represent the text mode as it appears the most amount of times.
The
number
values represent sub totals.

Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3

Many Thanks
Matt












  #18   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Determining the text mode from a variety of data types

Thanks Biff.

The light bulb finally went on!<g
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"T. Valko" wrote in message
...
They wanted to *ignore* the numbers and return only the *text* mode.

--
Biff
Microsoft Excel MVP


"RagDyeR" wrote in message
...
There's nothing wrong with the formula!

It *will* return either a number or a text value, whichever is the
largest
presence in the referenced array.

Did you copy it right from my post?
--

Regards,

RD
-----------------------------------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit !
-----------------------------------------------------------------------------------------------

"matt3542" wrote in message
...
Hi RagDyer, thanks for taking the time to devise something different but
unfortunately it is now returning the mode as a numeric value. Biff has
offered an answer which seems to work ok, cheers, matt

"RagDyer" wrote:

Try this *array* formula which will still work for numbers and/or text,
and
will by-pass blank cells:

=INDEX(A1:A10,MODE(IF(A1:A10<"",MATCH(A1:A10,A1:A 10,0))))
--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter,
instead
of
the regular <Enter, which will *automatically* enclose the formula in
curly
brackets, which *cannot* be done manually. Also, you must use CSE when
revising the formula.

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit
!
---------------------------------------------------------------------------

"matt3542" wrote in message
...
Hi RagDyeR,

Thanks for the reply. Unfortunately it is returning 0 as the result -
apologies I should of added that there are more empty cells than
completed
cells, i.e

a1 blank
a2 blank
a3 blank
a4 3
a5 cat
a6 cat
a7 blank

Ideally the expected text string mode would be "cat" but as per the
above
it
is returning 0. Please can you advise if there is a way around this?

Thanks
Matt

"RagDyeR" wrote:

Try this - works for text and/or numbers:

=INDEX(A1:A10,MODE(MATCH(A1:A10&"",A1:A10&"",0)))

This formula counts empty cells as zero, so if you sized the range
where
empty rows outnumbered those with values, you'd get a 0 return.

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"matt3542" wrote in message
...
Hi Pete, ideally the value returned would be "Ear Infection" as this
is
the
text string that appears the most.

Thanks
Matt

"Pete_UK" wrote:

So what is it that you want to end up with?

Pete

On Jul 30, 3:31 pm, matt3542
wrote:
Dear Forum,

I would be very grateful if anyone can provide a solution to the
following
problem;

I have a dataset as per the example below that consists of text
and
numbers.
I am trying to determine the mode based on the text entries and
not
the
number entries. In the example below the entry "ear infection"
would
represent the text mode as it appears the most amount of times.
The
number
values represent sub totals.

Ear infection
Ear infection
Sinusitis
Ear infection
D&V
5
D&V
Rash on leg
Migraine
3

Many Thanks
Matt














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
Excel 2007 error "some chart types cannot be combined with other chart types. Select a different chart types" roadsidetree Charts and Charting in Excel 15 June 2nd 09 10:53 AM
Determining AM or PM in text string Bob Excel Worksheet Functions 8 October 27th 06 12:55 PM
Data types when importing Excel data to SQLServer [email protected] Excel Discussion (Misc queries) 1 September 27th 06 12:48 PM
Copying Data from Excel to MS Outlook in Plain Text Mode JohnGuts Excel Worksheet Functions 0 July 30th 06 09:57 PM
Text shifts left in Excel Combo Box when user types in entry shearston1010 Excel Discussion (Misc queries) 0 October 20th 05 03:49 PM


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