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

Author Topic: Looking for some excel help  (Read 2725 times)

0 Members and 1 Guest are viewing this topic.

petie86

    Topic Starter


    Newbie

    • Experience: Experienced
    • OS: Windows 10
    Looking for some excel help
    « on: January 28, 2018, 12:54:48 PM »
    Not sure if right place did try to search but couldn't find anything.

    What I'm trying to do is get the sum of numbers in 1 column but only if the rows in another column evaluate to true
    for example, Column A is for Male/Female (1 for male, 0 for female) column B is how much each spends on shopping.
    I want the average Male spend, and then the average female spend.
    So was thinking along the lines of a countif (a2:a50, "0",b2:b50) ??
    All i have managed so far playing around is o count how many 1's or 0's but not the sum, if you know what I mean?

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: Looking for some excel help
    « Reply #1 on: January 28, 2018, 02:47:40 PM »
    There are a number of other 'IF' Functions. It sounds like you want AVERAGEIF rather than COUNTIF. There is also SUMIF. They all work the same way as COUNTIF. First argument specifies the range to look for the criteria. second argument is the criteria to look for in the first argument range, and last argument is the range of corresponding values to sum. Should be a "drop-in"  replacement for COUNTIF in your formula.
    I was trying to dereference Null Pointers before it was cool.

    petie86

      Topic Starter


      Newbie

      • Experience: Experienced
      • OS: Windows 10
      Re: Looking for some excel help
      « Reply #2 on: January 29, 2018, 01:51:10 AM »
      Thank you, worked a treat, used [ =averageif(a2:a100,"0",b2:b100) ]