+ Reply to Thread
Results 1 to 5 of 5

Counting multiple instances of same name and calculating charges that exceeding 5 postings

  1. #1
    Registered User
    Join Date
    09-10-2012
    Location
    Pittsburgh PA
    MS-Off Ver
    Excel 2010
    Posts
    8

    Counting multiple instances of same name and calculating charges that exceeding 5 postings

    I have names that appear in column B that may appear once or 30 to 40 times. Each of those names has a charge assoiated with it (column C). A contract was negotiated that states the charges will remain consistent up to five charges, and after that the customer (column B) will only get charged $5.00 per entry.

    I need to count how many times the customer appears in column B, calculate how much they were charged, then figure out how much they were overcharged.
    Last edited by Tom Collins; 09-11-2012 at 01:39 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,042

    Re: Counting multiple instances of same name and calculating charges that exceeding 5 post

    Use COUNTIF to count them and SUMIF to work out how much they've been charged.

    Or maybe use a Pivot Table.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-10-2012
    Location
    Pittsburgh PA
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Counting multiple instances of same name and calculating charges that exceeding 5 post

    The problem I have with that is, the same answer will appear next to the name each time it is listed. I would like the first five instances of the names to read "OK", or something like that and additional instances to show the overcharge.
    Last edited by Tom Collins; 09-11-2012 at 01:51 PM.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Counting multiple instances of same name and calculating charges that exceeding 5 post

    If you want to print OK/Overcharge in new column then use.

    =IF(COUNTIF(B$2:B2,B2)<=5,"OK",MIN(C2,5))

    copied down.

    You can also use

    =IF(COUNTIF(B$2:B2,B2)<=5,C2,MIN(C2,5))

    this will return the C2 value if the count is less than or equal to 5.

    Also, in case the overcount charges are less than 5, I included the MIN(C2,5) to take the minimum of C2 value or 5.... but you can replace with just 5 if that is fixed for counts over 5....
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  5. #5
    Registered User
    Join Date
    09-10-2012
    Location
    Pittsburgh PA
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Counting multiple instances of same name and calculating charges that exceeding 5 post

    I like it!

    Thanks!

+ 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