Percentage Question

Helpmepleasehahaha

New Member
Joined
Aug 12, 2019
Messages
3
Hello,

I am trying to calculate the percentage of non-contiguous cells that contain the letter "a" out of all the selected non-contiguous cell. I am new to this site and am unsure how to upload reference images. I shall try to explain this as best i can. The target cell is Q2. i want to be able to calculate the percentage of the following cells when their value is "a", thus showing me what percentage equals "a". This sheet is for showing what vehicles my job uses and the letter "a" represents vehicles that are fully functional. Any other character or value represents that the vehicle is down for maintenance.
B8,B10,B14,B16,B20,B22,F8,F10,F12,F14,F18,F20,F22,F24,F26,F28,J8,J10,J12,J16,J18,
O8,O10,O14,O18,O22,O24,26,O28,S8,S10,S12,S14,S18,S22,S24,W8,W10,W12,W14,W16,
W18,W20,W22,W24,W26,W28

Any help will be much appreciated. Thank you.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Welcome to the forum.

Working with non-contiguous ranges is a pain. In many cases, we can use MOD or INT functions to construct a rule that includes all of the cells, but in this case, your cells are pretty scattered. This leaves you having to individually list each cell in your formula. This should do what you want:

=SUMPRODUCT(COUNTIF(INDIRECT({"B8","B10","B14","B16","B20","B22","F8","F10","F12","F14","F18","F20","F22","F24","F26","F28","J8","J10","J12","J16","J18","O8","O10","O14","O18","O22","O24","O26","O28","S8","S10","S12","S14","S18","S22","S24","W8","W10","W12","W14","W16","W18","W20","W22","W24","W26","W28"}),"a"))/47
 
Upvote 0
Hello,

Any help will be much appreciated. Thank you.

You could try something like this(but with your ranges filled in)
=SUM(COUNTIF(INDIRECT({"A23:A34","A3"}),"a"))/SUM(COUNTIF(INDIRECT({"A23:A34","A3"}),"<>xxxxxxxxxxxx"))

Not sure if the full value of the cell is "a" or if it only just contains "a" somewhere inside the cell
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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