1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Excel spreadsheet formula

Discussion in 'Technology Advice' started by subseastu, Mar 17, 2015.

  1. subseastu
    Offline

    subseastu I'm Bruce Wayne Lifetime Member

    I'm currently doing a college course and I've hit a bit of a stumbling block. A question says to create a spread sheet for 20 new applicants to a gym. This I've done as you can see. One question asks to calculate the percentage of male to female ratio, this will go into box next to Eiii. Is there a formula to work this out?

    The second question asks to work out the subscriptions for the year for junior (11 - 18), full (19 - 64) and senior (65 - 80) members. Again I've no idea how to write something for this that will be able to determine the groups, sort them and multiply by the correct subscription amount.

    Is there anyone cleverer than me (without a doubt) that has any idea on how this is / can be done please? Pretty please.

    upload_2015-3-17_8-22-40.png
  2. Anon220806
    Offline

    Anon220806 Well-Known Member

    Ha. Easy if you know how. But I dont. I use excel a lot but mainly for processing calculations.

    I would be interested to know the solution.
  3. oss
    Offline

    oss Somewhere Staff Member

    I'll take a look at this tonight when I get home, the first thing you need is COUNTIF() function for example

    =COUNTIF(B2:B50,1)
    =COUNTIF(B2:B50,2)

    that will count the number of one's and two's in the second column from which you can work out the percentage male female, it could also work if the column contained M and F and the conditions was modified to "M" and "F" for example =COUNTIF(B2:B50,"M")

    There are a number of other ways to use the COUNTIF() function to partition your list into age groups for example =COUNTIF(A2:A50,">=11") - COUNTIF(A2:A50,"<=18") would count all those aged 11 to 18 and likewise you can partition the other ranges as well.
  4. Anon220806
    Offline

    Anon220806 Well-Known Member

    Nice one. I often wondered how that sort of thing was done.
  5. oss
    Offline

    oss Somewhere Staff Member

    I don't use spreadsheets much these days, but I did use them a lot back in the late 1980's, they are great modelling tools, great for 'what if' types of questions but too many people end up using them as databases and get themselves into a mess, accountants tend to do that a lot.

    But the range of options available in a spreadsheet these days is truly huge and with enough will you can force them to behave like a dedicated computer program but that is usually taking things to far :)
  6. Dave_E
    Offline

    Dave_E Well-Known Member Trusted Member

    Don't forget to insert a pie chart! :like:
  7. Anon220806
    Offline

    Anon220806 Well-Known Member

    Yes. I worked with a guy who used to make some cracking macros with excel. He made it an art form.
  8. subseastu
    Offline

    subseastu I'm Bruce Wayne Lifetime Member

    Fantastic. Thank you. I''l look at this later this morning. Many thanks
  9. subseastu
    Offline

    subseastu I'm Bruce Wayne Lifetime Member

    A little bit of jiggling around but it works spot on now.

    =COUNTIF(A4:A23,">11") - COUNTIF(A4:A23,">18")

    For the subscription part
    =(COUNTIF(A4:A23,">11")-COUNTIF(A4:A23,">18"))*360

    Thanks for the assistance, a massive help
  10. Anon220806
    Offline

    Anon220806 Well-Known Member

    Good stuff. If it had been me I would have put the ones and twos in seperate columns and summed them. It would have worked but would have been far less tidier than with Oss's solution.
  11. Markham
    Offline

    Markham Guest

    If you had summed the columns you would get an incorrect answer for your "2"s column.
  12. Anon220806
    Offline

    Anon220806 Well-Known Member

    No you wouldnt.

    Not if you used a 1 in each column.
  13. Anon220806
    Offline

    Anon220806 Well-Known Member

    Next snipe Markham?
  14. Markham
    Offline

    Markham Guest

    But you said
  15. Anon220806
    Offline

    Anon220806 Well-Known Member

    Yes. But you knew what I meant. You were just being a pedant.
  16. oss
    Offline

    oss Somewhere Staff Member

    Yeah but what he meant was take Stu's ones and two's and put the markers in two separate columns and sum them, not the literal values, that's the way I read it.

    What he meant was an

    =IF(B9=1,1,0) in one column
    =IF(B9=2,1,0) in the next column

    and a sum at the bottom of each of these columns.
  17. Anon220806
    Offline

    Anon220806 Well-Known Member

    Or...


    You could sum the 1s in each column. Then work out the ratio in a seperate cell for the male to female ratio.

    Nowhere near as neat. But it works.
    Last edited: Mar 18, 2015
  18. Anon220806
    Offline

    Anon220806 Well-Known Member

    People here use Mathcad for their engineering stuff, Oss. I use Excel for any maths that needs to be done. I do sometimes wish I knew more of Excels features though. This one that Stu has illustrated is a good one.
  19. Dave_E
    Offline

    Dave_E Well-Known Member Trusted Member

    John, you could count rather than sum.

    Then it does not matter what you have in your columns.:D
  20. Anon220806
    Offline

    Anon220806 Well-Known Member

    If it is a long column though?

Share This Page