Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: how to simplify this long function in MS Excel  (Read 2142 times)

0 Members and 1 Guest are viewing this topic.

kwfine

    Topic Starter


    Intermediate
    how to simplify this long function in MS Excel
    « on: May 11, 2008, 10:35:35 AM »
    Hi,
    I am learning MS Excel.
    I have written a function to count the number of students in a particular group:
    =countif(A1:E1, F1)+countif(A1:A9, F2)+countif(A1:A9, F3)+countif(A1:A9, F4)
    +countif(A1:A9, F5)+countif(A1:A9, F6)+countif(A1:A9, F7)+countif(A1:A9, F8)
    +countif(A1:A9, F9)+countif(A1:A9, F10)+countif(A1:A9, F11)+countif(A1:A9, F12)
    ...
    +countif(A1:A9, F37)+countif(A1:A9, F38)+countif(A1:A9, F39)+countif(A1:A9, F40)

    it works but it looks so long and clumsy.
    I would like to simplify it but I don't know how to.
    Could you help me out please?


    davidoc



      Beginner
      Re: how to simplify this long function in MS Excel
      « Reply #1 on: May 11, 2008, 11:48:30 AM »
      I think I know what you are after but could you attach the worksheet so as i can see it please
      Always listen to what others have to say...there will be a time when you will want others to listen to you.

      squall_01



        Prodigy

        Thanked: 80
        Re: how to simplify this long function in MS Excel
        « Reply #2 on: May 11, 2008, 11:59:02 AM »
        Couldn't you just use the crtl key an click the cells you want in the countif formula or is this how your to suppose to have it?
        Windows 7 RC Tester.  Working on it.  Your monitor says etchasketch on the side!

        If I fall who is there to pick me up now.  I stand alone but I stand as the gaurdian for whom I wish to protect.  The sound of my blade utters my name as you fall.  For I shall not move.  For those that forsake the very people are wosres