Excel formula to delete rows with conditions

Anonymous
2020-08-11T11:13:57+00:00

Good Morning

I have a large Excel table with two entries per company that are always in the same order.  I would like to update the table by eliminating one of the two entries using an Excel formula with conditions.  Here is an example of the table:

I would like to use a formula to delete the first row for each company with the condition that the CO_ID are identical.  In other words, before deleting the first row for CO A, I would like the formula to check that the CO_ID for CO A are equal.

Thank you for taking the time to read and respond to this request.

Al

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2020-08-11T11:58:58+00:00

    Hi almc_749

    Formulas can not delete a row. 

    Please, try the following steps

    1- Select the entire EXP column

    2-Go to Find & Select\ Go to special

    3-Select "Blanks" and hit OK

    4-With the selection right-click and Delete

    5- Delete\ Entire Row

    RESULTS

    If you frequently have to do it, then I suggest you record a macro of the above steps.

    Do let me know if you need more help

    On the other hand,

    If the answer helped you.

    Please, consider marking this thread as answered.

    It would help others in the community with similar questions or problems.

    Thank you in advance

    Regards

    Jeovany

    24 people found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2020-08-11T11:31:46+00:00

    Hi Almc_749,

    I am John, an Independent Advisor and a Microsoft user like you. I'm here to work with you on this issue.

    Please refer to the link below on different methods on how to delete rows with condition.

    https://yodalearning.com/tutorials/how-to-delet...

    Note: This is a non-Microsoft website. The page appears to be providing accurate, safe information. Watch out for ads on the site that may advertise products frequently classified as a PUP (Potentially Unwanted Products). Thoroughly research any product advertised on the site before you decide to download and install it.

    I hope it worked out well for you. If not, please reply back to this forum to let me know. I will be glad to follow up and help you.

    Regards,

    John

    0 comments No comments
  2. Anonymous
    2020-08-11T12:09:41+00:00

    Assuming the EXP column is in column "C"

    You could try to use this macro

    *****************************************************************************

    Sub DeleteRowsWithConditions()

        Columns("C:C").SpecialCells(xlCellTypeBlanks).EntireRow.Delete

        Range("C1").Select

    End Sub

    ******************************************************************************

    Change the column according to your scenario

    0 comments No comments
  3. Anonymous
    2020-08-11T12:24:33+00:00

    Bingo!

    First of all, your method of illustrating the solution is perfect.  Embarrassed to tell you how many times I went through steps 1-5 without recognizing that I had the opportunity to click on entire row.  Bingo again.

    Thank you.

    Al

    1 person found this answer helpful.
    0 comments No comments