+ Reply to Thread
Results 1 to 3 of 3

Multiple conditions in counting

  1. #1
    Registered User
    Join Date
    07-07-2015
    Location
    Seattle
    MS-Off Ver
    2008 for Mac
    Posts
    3

    Multiple conditions in counting

    Hi guys-

    I'd appreciate a second set of eyes on a problem. I have a huge data sheet on Farmer's Markets throughout the United States. I have to find out how many farmers markets there are per capita in each state. The catch is that I must exclude all Farmer's Markets in cities with more than 1 word in their name. I used a Len(Trim) equation to give me values for the number of words in the city name so it looks like this:

    Screen shot 2015-07-07 at 2.54.06 PM.png
    Attached Images Attached Images
    Last edited by jduffy0920; 07-18-2015 at 12:03 AM.

  2. #2
    Registered User
    Join Date
    07-07-2015
    Location
    Seattle
    MS-Off Ver
    2008 for Mac
    Posts
    3

    Re: Multiple conditions in counting

    Essentially, I guess I'm asking how could I ask excel to sum the values of 1 for each state without having to manually select the cells for each 50 states. Thanks!

  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Multiple conditions in counting

    Assuming that your data is in columns A to C and down to row 300 (change ranges to suit your data)

    Create a helper column D and enter this formula in D2 and fill down. This formula will enter a 2 if more than 1 word and 1 if a single word.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Create another column for a unique listing of the states. I used column F and entered this formula and filled down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    I then used this formula in column F starting in F2 and filled down. This sums all the values for each single word cities for each state:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

+ 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. Counting with multiple conditions
    By liln5k in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-11-2014, 08:10 PM
  2. Counting with multiple conditions
    By BradDenton in forum Excel General
    Replies: 8
    Last Post: 05-31-2012, 03:37 PM
  3. Counting multiple Conditions
    By Joeysparrow in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-09-2012, 08:50 PM
  4. Counting multiple conditions
    By Sippy69 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-10-2008, 09:12 PM
  5. Counting with multiple conditions
    By Littleoladywho in forum Excel General
    Replies: 4
    Last Post: 09-19-2007, 04:40 PM

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