+ Reply to Thread
Results 1 to 9 of 9

SUMIF / SUMPRODUCT Funtion

  1. #1
    Registered User
    Join Date
    11-02-2014
    Location
    Berlin, Germany
    MS-Off Ver
    Microsoft Office 2010
    Posts
    16

    Question SUMIF / SUMPRODUCT Funtion

    Hi, I need help with a SUMIF / SUMPRODUCT function. I've managed to list the categories in the DATA sheet. Now I'd like to filter on men and women. In the Gender column, 1=man and 2=woman.

    How can I change my function to make that work?

    Thanks!

    150225_BAW Ausw_JeLa.xlsx

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: SUMIF / SUMPRODUCT Funtion

    Just use filter. No need for a function. Select any cell in the gender column. On the home tab choose Sort & Filter, then filter. Click the button that shows up in C2 and make your choice.

    Maybe this is what you are after.
    Attached Files Attached Files
    Last edited by skywriter; 02-25-2015 at 03:22 PM.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  3. #3
    Registered User
    Join Date
    11-02-2014
    Location
    Berlin, Germany
    MS-Off Ver
    Microsoft Office 2010
    Posts
    16

    Re: SUMIF / SUMPRODUCT Funtion

    Thanks, I need to include the misspellings in the categories tab though, which are now left out. Using the filter function unfortunately won't suffice. I need to fix it with help of a function.

  4. #4
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: SUMIF / SUMPRODUCT Funtion

    I can create a user defined function, are you okay with that.

  5. #5
    Registered User
    Join Date
    11-02-2014
    Location
    Berlin, Germany
    MS-Off Ver
    Microsoft Office 2010
    Posts
    16

    Re: SUMIF / SUMPRODUCT Funtion

    I'm not quite sure what you mean with 'user defined', but I'd be very curious to see Thanks for helping me out!

  6. #6
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: SUMIF / SUMPRODUCT Funtion

    A user defined function means I write a function with code and then you use it just like you would Sum or Average, or any other function which means you type = the function name and then you have to enter certain arguments in a certain order and then hit enter and the function returns the results. I went ahead and built it anyway because according to this site I'm addicted to Excel, which I am, so I needed something to do.
    If you like it and this is not the actual sheet you are going to use I will help you get it to the other sheet. The function is already installed and it seems to work well. It's called "FilterCount".
    Good Luck!!!
    Attached Files Attached Files
    Last edited by skywriter; 02-25-2015 at 07:23 PM.

  7. #7
    Registered User
    Join Date
    11-02-2014
    Location
    Berlin, Germany
    MS-Off Ver
    Microsoft Office 2010
    Posts
    16

    Re: SUMIF / SUMPRODUCT Funtion

    That is very impressive

    Is there an easy way for me to understand how you wrote the code, so that I can recreate a similar solution myself? I'm trying to improve my Excel skills and I'd love to know how you created this custom function!

  8. #8
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: SUMIF / SUMPRODUCT Funtion

    Well you have many sources to learn VBA for yourself. There's a ton of videos on the internet and lots and lots of books.
    I can give you a brief rundown of what it does.
    Basically it takes your categories that we a looking to match and puts them into an array. It then takes the cells that we want to match and compares then one at a time to the categories. Looping is not the fastest way to do things in code, but my understanding is looping through and array is faster than looping through the cells. I also have code that looks at the 1 or 2 first and if that's not what we're looking for it skips all of those cells so that speeds it up and if a cell is empty it skips that cell also. So I've made it faster than if I had not ignored blank cells. To you and I it happens instantaneously so that's good.

    Start here and decide if you like it.
    http://youtu.be/AIhKNNXzZLM

    Good Luck!!!

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: SUMIF / SUMPRODUCT Funtion

    With D2 is 1 or 2 (men or women),try in D3 sheet Companies:

    Please Login or Register  to view this content.
    Quang PT

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sumproduct and frequency funtion sorting
    By nparsons75 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-06-2014, 08:16 AM
  2. [SOLVED] Need help with useing Sumproduct with named range and date funtion
    By fgruhlke in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 02-17-2014, 11:17 PM
  3. Dynamic shifting range for SUMIF funtion
    By irishkingkong in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-21-2013, 05:20 AM
  4. [SOLVED] Autofilling SUMIF funtion
    By inheaven in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-02-2013, 10:52 PM
  5. Replies: 0
    Last Post: 08-17-2012, 02:02 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1