SOLVED

Excel Function or Formula

%3CLINGO-SUB%20id%3D%22lingo-sub-2206362%22%20slang%3D%22en-US%22%3EExcel%20Function%20or%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2206362%22%20slang%3D%22en-US%22%3E%3CP%3ETrying%20to%20get%20a%20percentage%20of%20a%20text%20from%20a%20column...%20Tried%20COUNTIF(B2%3A600%2C%22B%22)%2FCOUNTA(B2%3AB600)%2C%20but%20it's%20not%20accurate.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2206362%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2206406%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Function%20or%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2206406%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F995893%22%20target%3D%22_blank%22%3E%40BR0_5%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat's%20percentage%20of%20cells%20with%20values%20as%20letter%20B.%20What%20do%20you%20mean%20under%20%22%3CSPAN%3Enot%20accurate%22%20%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2206428%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Function%20or%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2206428%22%20slang%3D%22en-US%22%3EYes%20percentage%20of%20cells%20with%20letter%20B.%20When%20I%20used%20the%20formula%20above%20the%20outcome%20is%20not%20correct.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2206445%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Function%20or%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2206445%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F995893%22%20target%3D%22_blank%22%3E%40BR0_5%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhat%20means%20not%20correct%3F%20That's%2078.5999999%25%20instead%20of%2078.6%25%20or%20that's%2010%25%20instead%20of%2090%25%20%3F%3C%2FP%3E%0A%3CP%3EWhy%20don't%20you%20provide%20some%20sample%20like%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20518px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F263320iC46A235D22ED0A4B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2206490%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Function%20or%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2206490%22%20slang%3D%22en-US%22%3EThat%20is%20correct.%20If%20you%20want%20to%20divide%20by%20total%20number%20of%20rows%20and%20not%20the%20number%20of%20rows%20that%20have%20text%20in%20them%20you%20can%20use%20%3DCOUNTIF(A1%3AA13%2C%22B%22)%2FROWS(A1%3AA13)%3C%2FLINGO-BODY%3E
Occasional Contributor

Trying to get a percentage of a text from a column... Tried COUNTIF(B2:600,"B")/COUNTA(B2:B600), but it's not accurate. 

11 Replies

@BR0_5 

That's percentage of cells with values as letter B. What do you mean under "not accurate" ?

Yes percentage of cells with letter B. When I used the formula above the outcome is not correct.

@BR0_5 

What means not correct? That's 78.5999999% instead of 78.6% or that's 10% instead of 90% ?

Why don't you provide some sample like

image.png

@Sergei Baklan 

 

100% is not correct, please see below:

BR0_5_0-1615589234870.png

 

 

best response confirmed by BR0_5 (Occasional Contributor)
Solution
That is correct. If you want to divide by total number of rows and not the number of rows that have text in them you can use =COUNTIF(A1:A13,"B")/ROWS(A1:A13)

@BR0_5 

Another variant could be

=COUNTIF(A1:A10063,"b")/(COUNTA(A1:A10063)+COUNTBLANK(A1:A10063))
What if I add 2 or more text values in column A such as “c” and “nr”? Would you recommend a different formula?
you can try this: =COUNTIF(A1:A100,"> ")/ROWS(A1:A100)
What if the number of rows keeps changing?
what is the number of rows based on? If you want to include blank cells in the denominator you have to give us something to go on. Is there another column that isn't blank that you can use to count the total number of rows to use?
The number of rows based on # of shots and “b” is made shots. I could use another column that isn’t blank to count the number of total rows...