Trying to divide a cell value by a countif value

mtaylor

Board Regular
Joined
May 1, 2013
Messages
73
Platform
  1. Windows
  2. MacOS
Hi Team,

Weird one this. I have set my formula to this: =(countif(C3:AI3,"*")/(AJ3)*100) and it works.

However I want it the other way round: =(AJ3)/(countif(C3:AI3,"*")*100) and it comes as 0, whereas it should be 100

Tell me doing something stupid!?

Thanks

Matt
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hard to tell without knowing what is in C3:AI3 ans AJ3
 
Upvote 0

KG1A
Name%22/0323/0324/0325/0326/0329/0330/0331/0301/0402/0405/0406/0407/0408/0409/0412/0413/0414/0415/0416/0419/0420/0421/0422/0423/0422/0323/0324/0326/0427/0428/0429/0430/04Days Present Total
Student's name0LPPPP5


This is for registers. L and P represent Late and Present.

The 5 at the end is counting how many L's and P's appear in the dates 22/03 to 30/04.

Hope this is more useful than my original post?

Matt
 
Upvote 0
The cell with the '5' in uses the formula: =COUNTIF($C3:$AI3,"P")+COUNTIF($C3:$AI3,"L")
 
Upvote 0
If you are expecting 100 as the result of the 2nd formula, then perhaps you meant this?

=AJ3/COUNTIF(C3:AI3,"*")*100
 
Upvote 0
BTW, why use COUNTIF with *? why not COUNTA?
I initially wondered if it was deliberate as they behave differently if any numerical values are in the range. Looking at post # 3 though that appears unlikely.

COUNTA may be all that is required in AJ3 as well?
 
Upvote 0

Forum statistics

Threads
1,214,385
Messages
6,119,210
Members
448,874
Latest member
b1step2far

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