+ Reply to Thread
Results 1 to 8 of 8

I want to eliminate the debit and credit

Hybrid View

optixbaba I want to eliminate the debit... 05-01-2013, 11:20 AM
FDibbins Re: I want to eliminate the... 05-01-2013, 11:39 AM
bebo021999 Re: I want to eliminate the... 05-01-2013, 11:54 AM
newdoverman Re: I want to eliminate the... 05-01-2013, 06:50 PM
AB33 Re: I want to eliminate the... 05-02-2013, 05:00 AM
tandwfund Re: I want to eliminate the... 05-02-2013, 11:09 AM
tandwfund Re: I want to eliminate the... 05-02-2013, 12:01 PM
Jarko28 Re: I want to eliminate the... 05-02-2013, 11:42 PM
  1. #1
    Registered User
    Join Date
    05-01-2013
    Location
    Nigeria
    MS-Off Ver
    Excel 2007
    Posts
    1

    Exclamation I want to eliminate the debit and credit

    Hi

    Please help me eliminate the repeated amount in different signs

    I have debits & credits in the same excel column and i want to delete the matching amounts but with opposite signs.

    Ope
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: I want to eliminate the debit and credit

    Hi and welcome to the forum

    next time, please give your thread a title that is a bit more descriptive of what you want

    try this approach...
    in C3, copied down, use this...
    =ABS(B3)
    then in D3, copied down, use this...
    =COUNTIF($C$3:$C$14720,ABS(C3))

    Sort the data in descending order and delete all rows down to (but excluding) 1

    OR if you dont want to sort, you could apply filters, filter on D to exclude 1, and delete what remains

    If you want, you can then delete the 2 helper columns (C&D
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

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

    Re: I want to eliminate the debit and credit

    @Fdibbins,
    I afraid that with ABS, 2 or more same amounts which all in credit(or all in debit) are deleted
    i.e row 21 & 22 with same debit of -21968081.19
    Quang PT

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

    Re: I want to eliminate the debit and credit

    There are over 3800 duplicates in this data and there are many blank cells in column A that have values in column B. Many of the values in column B show up more than 30 times and as many as 46 times.

    If this is valid data, it is going to be very difficult to be sure that the proper matching amounts are cancelling each other.
    <---------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

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: I want to eliminate the debit and credit

    See attached.
    Converted the values in +ve and then using Excel's remove duplicate function, I have deleted all in column C
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-31-2012
    Location
    Delaware, USA
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: I want to eliminate the debit and credit

    AB33,

    Hi - I am not sure this solution is providing what optixbaba is asking for. As I read his request, it sounds like he only wants to delete equal (+) and (-) values, not remove all duplicate values. See this sample, rows 50 - 53 in original tab....

    1900011379 9,355,939.20
    1900011395 9,355,939.20
    1900011396 -9,355,939.20
    1900011397 9,355,939.20

    IMHO, this part of the data should retain (2) values of 9,355,939.20. The resultant data provided only contains (1) of these values.

    Regards,

    Terry

  7. #7
    Registered User
    Join Date
    08-31-2012
    Location
    Delaware, USA
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: I want to eliminate the debit and credit

    AB33,

    Sorry I missed one number ....

    Terry

  8. #8
    Forum Contributor
    Join Date
    03-27-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: I want to eliminate the debit and credit

    Hi,

    I agree with tandwfund in the sense that this needs to account for the unique credit debit pair, but ignore all results with identical values that do not have a matching pair even if the same negative value exists and has already been paired.

    I also thought that this needed to take a look at the document ID and account for credits/debits for only items with the same document ID.


    My solution is attached. code below:

    
    Sub RemoveUniqueMatches()
    
    Application.ScreenUpdating = False
    
    'Declare variables
    Dim lr As Long
    Dim i As Long
    Dim c As Object
    Dim sht As Worksheet
    
    Set sht = ActiveSheet
    lr = sht.Range("B" & Rows.Count).End(xlUp).Row
    
    'Create Non Unique item and qty ID's
    With Range("c2")
    .Formula = "=CONCATENATE(A2,B2)"
    .AutoFill Destination:=Range("C2:C" & lr)
    End With
    
    'Create unique pair combination ID's
    With Range("D2")
    .Formula = "=SUBSTITUTE(c2&"" ""&COUNTIF($C$2:$C2,C2),""-"","""")"
    .AutoFill Destination:=Range("D2:D" & lr)
    End With
    
    'Hard Code Unique ID values
        Columns("D:D").Select
        Selection.Copy
        Range("D1").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    
    'Determine which Unique ID's have a matching pair
    With Range("E2")
    .Formula = "=COUNTIF(D$2:D30000,D2)"
    .AutoFill Destination:=Range("E2:E" & lr)
    End With
    
    'Delete matching pairs
    With Columns("E")
        .AutoFilter field:=1, Criteria1:=2
        .Resize(Rows.Count - 1).Offset(1).EntireRow.Delete
    End With
    ActiveSheet.AutoFilterMode = False
    
    'Delete the helper columns
    Range("C:E").Clear
    
    Range("A1").Select
    
        Application.ScreenUpdating = True
        
    End Sub
    Let me know if this works.

    Thanks.
    Attached Files Attached Files
    Last edited by Jarko28; 05-02-2013 at 11:53 PM.

+ 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