+ Reply to Thread
Results 1 to 4 of 4

How to delete rows

  1. #1
    Registered User
    Join Date
    09-18-2017
    Location
    Fortaleza, Brazil
    MS-Off Ver
    Excel Online
    Posts
    7

    How to delete rows

    Hello there,


    I have a document that contains information about students, such as the student ID, the discipline code and the grades corresponding to a specific discipline. I will attach the document so you guys can better understand it.

    The problem is that I need to guarantee that every student has taken all the disciplines. So, what I have to do is to analyse the student ID and check if all discipline's codes corresponds to that student. There is a total of 49 disciplines represented as CD01, CD02, CD03, ..., CD49 (Discipline Code). So, all students must have taken all the 49 courses. If a student has not completed all the courses, say for example, he has completed 48 (or less), I have to delete all the rows that contains informations about that students (we can do that by checking his ID I guess).

    The picture below shows a case of a student who has a discipline missing, in this case, the discipline with code equals to CD02. So, this student with ID: 200727040017, must have all the rows (his information) deleted. In the end of the process, only the information of students who have completed all disciplines must remain in the document.

    I would really appreciate if you guys could help me in this one. I will also put the document here in case you guys want to use it to work with. If you guys can post the resulting document after solving the problem I'd also appreciate.

    Thanks a lot.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to delete rows

    I would use a macro for this.

    first sort your data by column A and then column B

    Then put this formula into E2 and Fill Down
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then put this formula into F2 and Fill Down
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then select Select Column F and find the first 1. if Column E in the previous Row does not contain 49 then delete the previous selection.

    Sorry I got pulled away. This code seems to work. Please test carefully, as I have lost focus.

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 09-23-2017 at 07:35 AM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    09-18-2017
    Location
    Fortaleza, Brazil
    MS-Off Ver
    Excel Online
    Posts
    7

    Re: How to delete rows

    Hey, thanks for answering. I sorted the two first columns (A and B) using the option A-Z. Then I copied the formula: =IF(A2=A1,"",1) in E2 and filled down, but I got an error saying: 'We found a problem in this formula. Are you not trying to type a formula...?' (I translated the error from the portuguese version, so it might be slightly different). Do you know what is causing this error? Sorry, I have just a little experience with excel.


    obs: The excel version I'm using is excel 2016. Thanks in advance.
    Last edited by Urlant; 09-22-2017 at 08:11 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    05-11-2013
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    586

    Re: How to delete rows

    Hi Urlant,

    I have created a Pivot Table, see attached, which highlights the students who have not achieved the 49 Diciplines.
    In addition it also shows the students who achieved 50?
    This is as a result of duplications.
    Hope this helps.

    Regards

    peterrc
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA to delete rows starting from row 18 and delete data in one column from row 17
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2017, 04:54 PM
  2. Delete All Rows Below Criteria in Col A / Then Delete Specific Rows in Col E
    By LennyC91 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2016, 08:22 AM
  3. [SOLVED] Delete blank rows between data rows, shift rows up, then repeat
    By excelactuary in forum Excel General
    Replies: 2
    Last Post: 03-11-2013, 11:53 AM
  4. Replies: 5
    Last Post: 11-12-2012, 08:38 PM
  5. Macro to delete certain columns and delete rows based on time in another column
    By beepbeep27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2012, 11:47 AM
  6. delete duplicate rows, delete empty rows
    By loade in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-03-2012, 05:42 AM
  7. Delete & Merge Columns,Delete Rows with filter, etc
    By traderindia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2009, 02:12 AM

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