Excel Formula

Chris Waller

Board Regular
Joined
Jan 18, 2009
Messages
183
Office Version
  1. 365
Platform
  1. Windows
Dear All,

I am looking for an Excel formula that could perform quite a complex calculation. I need a formula that could pick numbers from a random list of numbers. First of all the formula should be able to pick out the number of 9s and 10s in the list and calculate them as a percentage of the whole and then find all the 0s to 6s and then calculate them as a percentage of the whole and then deduct one from the other. Can anyone offer any guidance? TIA
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
with your data in Column A

=((COUNTIF(A:A,"=9")+COUNTIF(A:A,"=10"))-(COUNTIF(A:A,"=0")+COUNTIF(A:A,"=6")))/COUNT(A:A)
 
Upvote 0
with your data in Column A

=((COUNTIF(A:A,"=9")+COUNTIF(A:A,"=10"))-(COUNTIF(A:A,"=0")+COUNTIF(A:A,"=6")))/COUNT(A:A)

Alan,

Thanks for the quick reply. The formula came in very handy and works a treat. Could I ask one supplementary question, and I don't know if this will happen. I have omitted the numbers 7 and 8 as pointed out in my earlier post. If I need to exclude these when I am calculating the percentage, how would I go about that? TIA
 
Upvote 0
Alan,

Thanks for the quick reply. The formula came in very handy and works a treat. Could I ask one supplementary question, and I don't know if this will happen. I have omitted the numbers 7 and 8 as pointed out in my earlier post. If I need to exclude these when I am calculating the percentage, how would I go about that? TIA

COUNT(A:A) gives the total in column A, and
COUNTIF(A:A,"=7") the total number of 7s in column A

thus total in column A to excl 7s and 8s will be COUNT(A:A) - (COUNTIF(A:A,"=7") + COUNTIF(A:A,"=8"))

therefore your formula will be

=((COUNTIF(A:A,"=9")+COUNTIF(A:A,"=10"))-(COUNTIF(A:A,"=0")+COUNTIF(A:A,"=6"))-(COUNTIF(A:A,"=7")+COUNTIF(A:A,"=8")))/(COUNT(A:A)-(COUNTIF(A:A,"=7")+COUNTIF(A:A,"=8")))
 
Upvote 0

Forum statistics

Threads
1,223,891
Messages
6,175,229
Members
452,621
Latest member
Laura_PinksBTHFT

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