Excel Help Please

Discussion in 'Software' started by Feriol, Dec 21, 2010.

  1. Feriol

    Feriol Private E-2

    I would like a formular to work out what percentage of cells in a range have a certain contents. the contents of the cells is preferably letters (eg 'H') as it makes assesing the information at a glance easier than numbers.

    So i want a cell to show what percentage of a range contain H. If it helps the percentage value of each cell in each range is 0.45%

    Cells in the range could have a variety of letters, but only one for each cell.

    I'm Guessing it should start with 'countif' or 'sumif', but my formula of =SUMIF(B10:F19,"H") or COUNTIF.... isn't adding up, i wonder if this is because conditional formatting is active on the cells too? also i can't work out how to get it as a percentage.

    Any help on whether this is possible is much appreciated.

    Edit. Just realised that countif works to give me a total, but it only does the sums when the file is re-opened, it doesn't do the sums as the cells are changed. Can Something be done about that?
     
    Last edited: Dec 21, 2010
  2. PC-XT

    PC-XT Master Sergeant

    On my Excel, it works. If, in the Tools menu, the Options dialog box, on the Calculation tab, you don't have Automatic Calculation selected, it may work differently. That sounds like the reason in this case.
     
  3. PC-XT

    PC-XT Master Sergeant

    In Excel 2007, it's here:
    Formulas tab>Calculation>Calculation Options>Automatic

    If, for some reason, that doesn't work, you could try, for example:
    =sumproduct((A1:A20="H")+0)
     
    Last edited: Dec 21, 2010
  4. PC-XT

    PC-XT Master Sergeant

    I forgot to show percent formulas. I'm assuming the range is B10:F19, you want the number of occurances of "H" in that range, and you have no empty cells in the range, or if you do, you don't want them counted:

    To calculate the percentage, you could use
    =COUNTIF(B10:F19,"H")/COUNTA(B10:F19)
    or
    =SUMPRODUCT((B10:F19="H")+0)/COUNTA(B10:F19)
    and then either multiply the result by 100 or format the cell to show the percentage.
     
  5. Feriol

    Feriol Private E-2

    Thanks for the reply.

    Calculations were on manual, i should have checked, i'm making additions to a file made by someone else, and mine are always automatic so didn't think.

    Unfortunately I get a devide by zero error with your formula so I have set it to do a seperate calculation to work out the percentage.

    Appreciate the help.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds