Help with excel calculation

lostboyca

Board Regular
Joined
Nov 2, 2005
Messages
62
Please help me figure this calculation out Please go to http://www.diversityrus.com/help.zip for the file

% Comp. (H10) = I need to do a calculation such as: IF there is text in a cell J11:O26 count each cell as one THEN DIVIDE by the number of cells in J11:O26 which will give me the percentage.

This will be the start but there are more calculations but this will help me start it out.

Thanks


lostboyca
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Chitosunday

Well-known Member
Joined
Jul 14, 2003
Messages
1,018
=(COUNTA(J11:O26)+COUNTBLANK(J11:O26)) will give total
to get the percentage use the first formula then divide
like this
=COUNTA(J11:O26)/(COUNTA(J11:O26)+COUNTBLANK(J11:O26))
 

lostboyca

Board Regular
Joined
Nov 2, 2005
Messages
62
Thanks for the calculation now I have another question.

I need another calculation for H5 I would like it to calculate the following

I would like it to count all cells containing the text Pass in J11:O26 plus J29:O36 plus J39:O59 then divide all cells with and without text on J11:O26 plus J29:O36 plus J39:O59 which should give me the average

Thanks,

lostboyca
 

Yogi Anand

MrExcel MVP
Joined
Mar 12, 2002
Messages
11,454
Hi lostboyca:

How about the following array formula ...

=(COUNTIF(J11:O26,"pass")+COUNTIF(J29:O36,"pass")+COUNTIF(J39:O59,"pass"))/(COUNTA(J11:O59&"")-COLUMNS(J:O)*(ROWS(1:4)))
 

Chitosunday

Well-known Member
Joined
Jul 14, 2003
Messages
1,018

ADVERTISEMENT

Here is a formula without using arrays

=COUNTA(J11:O26,J29:O36,J39:O59)/(COUNTA(J11:O26,J29:O36,J39:O59)+COUNTBLANK(J11:O26,J29:O36,J39:O59))
 

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
20,224
Office Version
  1. 365
Platform
  1. Windows
Try...

=AVERAGE(IF(1-ISNUMBER(MATCH(ROW(J11:O59)-ROW(J11)+1,{17,18,27,28},0)),(J11:O59="Pass")+0))

...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

Hope this helps!
 

lostboyca

Board Regular
Joined
Nov 2, 2005
Messages
62

ADVERTISEMENT

Yogi Anand/Domenic –

Your script works now the question I have is that can you break down the script in English? I want to add more rows and cells to the calculation.

Chitosunday –
Your script did not work it error out and highlighted COUNTBLANK(J11:O26,J29:O36,J39:O59))


Thanks,

Lostboyca
 

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
20,224
Office Version
  1. 365
Platform
  1. Windows
lostboyca said:
Your script works now the question I have is that can you break down the script in English? I want to add more rows and cells to the calculation.

With regards to my formula...

1) replace the references to J11:O59 with references to your new range, and

2) change the array constant {17,18,27,28} to specify which row, relative to the first row in your table, to exclude from the calculation. In this case, rows 17, 18, 27, and 28 are excluded from the calculation.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,026
Messages
5,835,020
Members
430,332
Latest member
Charly_Moon

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
Top