Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ron
 
Posts: n/a
Default formula won't work unless column of data is a hard number

In col A I have 17 character code and in Col B I do a replace 11 characters
so just the first 6 characters are left and in Col B
Col A Col B
abcdefXXXXXXXXXXX abcdef
In col C I want to countif(b1:b100,"abcdef")
I will get 0 unless I go back and type in every cell in col B and then the
formula counts the correct number of matches.
Any help as to how I can correct this without retyping each cell in Col B? I
have anywhere from 1000 - 9000 cells to match and count.
Thanks in advance for any help.

--
Ron
  #2   Report Post  
N Harkawat
 
Posts: n/a
Default

Seems like when you are using the replace function in column B your new text
you are replacing is " " (a space)
so what you are getting is "abcdef " (note the space after f) instead of
"abcdef"
Checkl the lenght of the string in cell B1 using LEN(B1) whether its 6 or 7
characters
If 7 then either modify your replace command or use the following countif
=COUNTIF(B1:B100,"abcdef ")

Or instead of using column B to assist in the count use this on column A
directly
=COUNTIF(A1:A100,"*abcdef*")



"Ron" wrote in message
...
In col A I have 17 character code and in Col B I do a replace 11
characters
so just the first 6 characters are left and in Col B
Col A Col B
abcdefXXXXXXXXXXX abcdef
In col C I want to countif(b1:b100,"abcdef")
I will get 0 unless I go back and type in every cell in col B and then the
formula counts the correct number of matches.
Any help as to how I can correct this without retyping each cell in Col B?
I
have anywhere from 1000 - 9000 cells to match and count.
Thanks in advance for any help.

--
Ron



  #3   Report Post  
Ron
 
Posts: n/a
Default

Thanks N Harkawat,
Your formula works. I will check the spacing...thank you very much!
--
Ron


"N Harkawat" wrote:

Seems like when you are using the replace function in column B your new text
you are replacing is " " (a space)
so what you are getting is "abcdef " (note the space after f) instead of
"abcdef"
Checkl the lenght of the string in cell B1 using LEN(B1) whether its 6 or 7
characters
If 7 then either modify your replace command or use the following countif
=COUNTIF(B1:B100,"abcdef ")

Or instead of using column B to assist in the count use this on column A
directly
=COUNTIF(A1:A100,"*abcdef*")



"Ron" wrote in message
...
In col A I have 17 character code and in Col B I do a replace 11
characters
so just the first 6 characters are left and in Col B
Col A Col B
abcdefXXXXXXXXXXX abcdef
In col C I want to countif(b1:b100,"abcdef")
I will get 0 unless I go back and type in every cell in col B and then the
formula counts the correct number of matches.
Any help as to how I can correct this without retyping each cell in Col B?
I
have anywhere from 1000 - 9000 cells to match and count.
Thanks in advance for any help.

--
Ron




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
Sort pages? David Excel Discussion (Misc queries) 15 May 13th 05 11:33 PM
How do I sort a column of data and have each data row sort accordi Oedalis Excel Discussion (Misc queries) 1 March 17th 05 11:52 PM
Data Table - Does it work with DDE links and stock tickers? Post Tenebras Lux Excel Discussion (Misc queries) 0 December 1st 04 05:15 PM
Formula to reference column heading JimDandy Excel Worksheet Functions 1 November 17th 04 04:06 PM
Formula to Extract Data from a Table Macshots Excel Worksheet Functions 2 November 5th 04 06:35 AM


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