+ Reply to Thread
Results 1 to 5 of 5

Formula to mark offsetting transactions

  1. #1
    Registered User
    Join Date
    01-13-2011
    Location
    Kansas City, United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    Formula to mark offsetting transactions

    I nee help developing a formula. I have an extremely large database of sales and I need to figure out how to mark the refunds to the matching sale.Here is an example of what my database looks like

    Cust # qty price
    12345 15 5
    12345 20 10
    12345 20 -10
    12345 20 10
    12345 15 10
    23666 20 -10

    I want to mark down the negative # and ONLY 1 corresponding positive #. In this case I wouldwant the formula to mark down row 2 & 3 excluding the headings. The customer number and the qty must match as well. Thanks

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

    Re: Formula to mark offsetting transactions

    Does this work?

    =IF(AND(COUNTIFS(A$2:A2,A2,B$2:B2,B2,C$2:C2,C2)=1,COUNTIFS(A:A,A2,B:B,B2,C:C,-C2)),"x","")

    assuming data is in A:C
    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.

  3. #3
    Registered User
    Join Date
    01-13-2011
    Location
    Kansas City, United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Formula to mark offsetting transactions

    This formula was working for the first 1500 entries and then all of the sudden it started marking all the entries even though it shouldn't have been. Can you help explain why and how to fix that. Thanks

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

    Re: Formula to mark offsetting transactions

    Can you attach sample workbook... only include the relevant columns and show the formula "not working".

  5. #5
    Registered User
    Join Date
    01-13-2011
    Location
    Kansas City, United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Formula to mark offsetting transactions

    This actually worked. It was just talking a long time becuase the database has over 600,000 rows.While loading the x's were there but now they are gone. Thank you so much

+ 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