+ Reply to Thread
Results 1 to 11 of 11

Find Max # in zip code range and then sum all numbers in that zip code

  1. #1
    Registered User
    Join Date
    08-01-2012
    Location
    Indpls, IN
    MS-Off Ver
    Excel 2010
    Posts
    14

    Find Max # in zip code range and then sum all numbers in that zip code

    In a nutshell I have a large spreadsheet with several zipcodes and the corresponding towns for those zip codes. I need to write a formula that says to look at the zip codes and tell me if the city customer count is the highest, if it is then sum all the city customers into that one city.

    I know that sounds weird, but I'm working with MapPoint and it will not let me load a zip code more than once, so for simplicity sake, I'm loading all the zip code customers into one city.

    I've attached in tiny sample of what I'm trying to do.
    Attached Files Attached Files
    Last edited by amyp22x3; 01-08-2013 at 12:27 PM.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Find Max # in zip code range and then sum all numbers in that zip code

    In D5:

    =MAX(INDEX($C$5:$C$13*($A$5:$A$13=A5),0))

    And in E5:

    =SUMIF($A$5:$A$13,A5,$C$5:$C$13)

    Copied down.

  3. #3
    Registered User
    Join Date
    08-01-2012
    Location
    Indpls, IN
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Find Max # in zip code range and then sum all numbers in that zip code

    This works, but can we add a True / False result in the Max(Index formula so I can filter on the "True" results?

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,358

    Re: Find Max # in zip code range and then sum all numbers in that zip code

    Hi,

    Does a Pivot Table answer help? Do you have repeated zips or cities? See attached.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Registered User
    Join Date
    08-01-2012
    Location
    Indpls, IN
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Find Max # in zip code range and then sum all numbers in that zip code

    Marvin,

    Not really because I need to be able to quickly filter my list and delete the rows I no longer need. The max(index formula is really close to what I need, but instead of a numeric result I need a true or a false. Is that possible?

    =MAX(INDEX($C$5:$C$13*($A$5:$A$13=A5),0))

    Thanks for both of your help, I really appreciate it!

  6. #6
    Registered User
    Join Date
    08-01-2012
    Location
    Indpls, IN
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Find Max # in zip code range and then sum all numbers in that zip code

    I added in a third column that has an OR(EXACT formula to tell me whether or not my Max(Index result matches my original Zip Code amount, if the answer is False, I can filter those out. This is a work around that would work, but I"m wondering how to edit the Max(Index to just include it? For some reason the thread won't let me attach the file, but here's the formula:= OR(EXACT(D5,C5))

  7. #7
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Find Max # in zip code range and then sum all numbers in that zip code

    So, rather than showing the MAX result you just want to know if each row equals the max result?

    =A5=MAX(INDEX($C$5:$C$13*($A$5:$A$13=A5),0))

  8. #8
    Registered User
    Join Date
    08-01-2012
    Location
    Indpls, IN
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Find Max # in zip code range and then sum all numbers in that zip code

    Here is what I typed: =A5=MAX(INDEX($C$5:$C$13*($A$5:$A$13=A5),0))

    I'm getting False results for every Zip.

  9. #9
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Find Max # in zip code range and then sum all numbers in that zip code

    Sorry, sorry, my fault:

    =C5=MAX(INDEX($C$5:$C$13*($A$5:$A$13=A5),0))

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

    Re: Find Max # in zip code range and then sum all numbers in that zip code

    A little bit correction: =C5=MAX(...)
    Quang PT

  11. #11
    Registered User
    Join Date
    08-01-2012
    Location
    Indpls, IN
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Find Max # in zip code range and then sum all numbers in that zip code

    Woot! Yes, that's perfect!! Thank you! :D

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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