a formula for counting a specific word in one cell "Trial" and converting it to a percentage

khollibygolli

New Member
Joined
Apr 17, 2023
Messages
12
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
  2. Web
in Google Sheets, In one cell A3, the amount of trials that were positive shows up ( Trial 1, Trial 2, Trial 3, Trial 4, Trial 5 or none). I would like the formula to count how many times the word "Trial" is in the cell and convert it to a percentage in B3 and copy it down through the column as new information is added.
Ex. nothing in cell = 0% / Trial 4 = 20% / Trial 1, Trial 3 = 40% / Trial 3, Trial 4, Trial 5 = 60% / Trial 1, Trial 2, Trial 3, Trial 4, Trial 5 = 100%


I don't know if it would matter, but there is another column C that lists the failed Trials, so idk if that would be needed in the formula to do the percentage
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
I have no way to test in google sheet, but try the following:

varios 28jun2023.xlsm
AB
1
2Trial 1, Trial 2, Trial 3, Trial 4, Trial 5100%
3Trial 1, Trial 2, Trial 3, Trial 480%
4Trial 1, Trial 2, Trial 360%
5Trial 1, Trial 240%
6Trial 120%
70%
Hoja9
Cell Formulas
RangeFormula
B2:B7B2=(LEN(A2)-LEN(SUBSTITUTE(A2,"Trial","")))/LEN("Trial")/5
 
Upvote 0
I have no way to test in google sheet, but try the following:

varios 28jun2023.xlsm
AB
1
2Trial 1, Trial 2, Trial 3, Trial 4, Trial 5100%
3Trial 1, Trial 2, Trial 3, Trial 480%
4Trial 1, Trial 2, Trial 360%
5Trial 1, Trial 240%
6Trial 120%
70%
Hoja9
Cell Formulas
RangeFormula
B2:B7B2=(LEN(A2)-LEN(SUBSTITUTE(A2,"Trial","")))/LEN("Trial")/5
I have another question.
i would like to add to this formula
my data automatically updates so i would like for the formula to update with it but not show 0% all the way down the column
i actually had to change the formula to B instead of A(i gave the wrong columns) and I know I can't attach it to column B since sometimes the info is blank and needs to be 0%
But if i could attach it to whether or not column A has info in it, then the formula will show, that would work for me.
 
Upvote 0
i actually had to change the formula to B instead of A(i gave the wrong columns) and I know I can't attach it to column B since sometimes the info is blank and needs to be 0%
But if i could attach it to whether or not column A has info in it, then the formula will show, that would work for me.

Try this:

Excel Formula:
=IF(A2="","",(LEN(B2)-LEN(SUBSTITUTE(B2,"Trial","")))/LEN("Trial")/5)
 
Upvote 0
OK I changed the formula to this so that it would go all the way down and stick even with new rows added...
=ARRAYFORMULA(IF(A2:A="","",(LEN(F2:F)-LEN(SUBSTITUTE(F2:F,"Trial","")))/LEN("Trial")/5))
But now i would like to move this formula to a different sheet tab and pull that info from Column A & F on my Sheet tab called 'Sheet Responses 1'
I can't figure out how to conjoin it all i guess
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top