ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   compare text in cells (https://www.excelbanter.com/excel-programming/450691-compare-text-cells.html)

[email protected]

compare text in cells
 
Hi, can you help me with formula for this:


XY A B C A B B A C 3

XX B C A B C A C B 2


I need to count "A" and sumarize it at end of row i.e. 3


Thank you.

Claus Busch

compare text in cells
 
Hi,

Am Sun, 1 Mar 2015 04:31:51 -0800 (PST) schrieb :

XY A B C A B B A C 3

XX B C A B C A C B 2

I need to count "A" and sumarize it at end of row i.e. 3


if your string is in B1 then:
=LEN(B1)-LEN(SUBSTITUTE(B1,"A",))

If "A" can occur in more columns, e.g . A1:C1 then:
SUM(LEN(A1:C1))-SUM(LEN(SUBSTITUTE(A1:C1,"A",)))
and insert this formula with CTRL+Shift+Enter


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

[email protected]

compare text in cells
 
On Sunday, 1 March 2015 14:23:00 UTC+1, Claus Busch wrote:
Hi,

Am Sun, 1 Mar 2015 04:31:51 -0800 (PST) schrieb :

XY A B C A B B A C 3

XX B C A B C A C B 2

I need to count "A" and sumarize it at end of row i.e. 3


if your string is in B1 then:
=LEN(B1)-LEN(SUBSTITUTE(B1,"A",))

If "A" can occur in more columns, e.g . A1:C1 then:
SUM(LEN(A1:C1))-SUM(LEN(SUBSTITUTE(A1:C1,"A",)))
and insert this formula with CTRL+Shift+Enter


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2



Thank you very much for help.
Solution was with COUNTIF ( maybe I did not explain correctly).
Rgds.



All times are GMT +1. The time now is 02:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com