+ Reply to Thread
Results 1 to 48 of 48

Removal of Duplicates reading /invalid rows

  1. #1
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Removal of Duplicates reading /invalid rows

    Hi Excel Experts,
    As per available readings data for different machines (Mch Code) , it consist of duplicates (more than 2 readings records per machines) for some machines. However, for analysis or efficiency calculation purpose, we want to keep it a single reading line per machine (Mch Code) basis following criteria...

    1. Firstly , 1st Reading is to be matched

    2. Secondly,
    a. In case of similar 1st Reading in multiple rows for similar machine (Mch Code) with IDENTICAL 1st Date (date & time), it should be considered ANY one row.
    b. In case of similar 1st Reading in multiple rows for similar machine (Mch Code) with DIFFERENT 1st Date (date & time), it should be considered a row with SMALLEST 1st Date (date & time)
    c. In case of similar 1st Reading in single row for similar machine, same row is to be considered.
    d. In case of 1st Reading is NOT MATCHING for specific machine, error message is to be appeared i.e. 1st Reading not appearing in (not matching with) available data.

    Please ref. to attached file for details

    At present we do this exercise manually (remembering above criterion), How to get this working with automatic formulas or VBA in Excel, help in this issue would be great! THANKS IN ADVANCE.

    Ravi
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,585

    Re: Removal of Duplicates reading /invalid rows

    I am not able to upload file. It is working.
    Try this

    Range R2:W2
    Mch Code |1st Date |2nd Date| 1st Reading| 2nd Reading| Diff

    ARRAY formula in R3, then drag down
    Please Login or Register  to view this content.
    ARRAY formula in S3, then drag across
    Please Login or Register  to view this content.
    Format cells as per requirement

    ARRAY formula is used

    To enter ARRAY formula
    Paste the formula
    Press F2
    Press Ctrl+Shift+Enter keys together.
    formula will be covered with{} brackets by excel.

  3. #3
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Dear Sir,
    Thanks for your reply; as per your instructions in reply, I have put formulae in R3 and S3 with pressing Ctrl+Shift+Enter keys together, however, it's not working.

    If it is working at your end forward file with formulae.

  4. #4
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Please revert

  5. #5
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Sir,
    Awaiting a great answer from you.

    - Ravi

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,175

    Re: Removal of Duplicates reading /invalid rows

    See attached based on kvsrinivasamurthy's reply.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Sir,

    Output is not appearing after clicking on after clicking on ENABLE EDITING
    (kindly ref. to attached snaps with ENABLE EDITING (before clicking) and without ENABLE EDITING (after clicking)

    Please help.

    Ravi

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,175

    Re: Removal of Duplicates reading /invalid rows

    I have downloaded the file I posted and it worked fine.

    I see the file is READ-ONLY: so save with new file name.

  9. #9
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Sir,

    saved as new file also, however, result is as same as mentioned in my previous mail ,( appearing out put is blank)

    - Ravi

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,175

    Re: Removal of Duplicates reading /invalid rows

    Don't understand why: As I haven't got Excel 2013 ..is there a setting needs changing??

    What happens if you activate "Formulas" ==>"Show Formulas" ?

    Copy/paste this into S3

    Please Login or Register  to view this content.
    Enter with Ctrl+Shift+Enter

    copy across and down

  11. #11
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Not working

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,175

    Re: Removal of Duplicates reading /invalid rows

    ... I have no further ideas if you cannot simply enter the formula!

    What happens if you activate "Formulas" ==>"Show Formulas" ?

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Removal of Duplicates reading /invalid rows

    John the dates in columns C and D are not numbers and VALUE is not converting them. I can't even get them to convert with "--". They are returning arrays of #VALUE! errors.
    Dave

  14. #14
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Removal of Duplicates reading /invalid rows

    Ravi_Kadu, I have applied this formula in temporary columns X and Y, used this formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    copied and pasted values only back to columns C and D.

    The formulas in S:W are functioning now.

  15. #15
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Sir
    Yes, it working now
    Thanks a lot...only thing is each and every-time we will have to..
    Copy and past values from columns X and Y column to columns C and D

    Ravi

  16. #16
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,175

    Re: Removal of Duplicates reading /invalid rows

    Select column C (row 3 down)

    Text-to-Columns ==>skip to Step 3 ==>check "Date"==>Finish: data converted to date/time format

    Repeat for D

    Still do not understand why it work as original where C & D are formatted as general.

  17. #17
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Removal of Duplicates reading /invalid rows

    @ JohnTopley, I also tried that and the "dates" in the upload still did not convert for me (Excel 2013).

    This is not the first time I have encountered this.

    It seems to coincide with some CSV source files. I have no idea what is going on ... unless it is some Excel 2013 'glitch'?

  18. #18
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Sir,
    Is there any way to make it in VBA, if issue is with formula.
    - Ravi

  19. #19
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Can any one help me to resolve it. Thank you for your help in advance
    - Ravi

  20. #20
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Can any one help me to resolve it. Thank you for your help in advance
    - Ravi

  21. #21
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Removal of Duplicates reading /invalid rows

    Standby,
    I have enlisted help and been working on it.
    I might have something for you but I have to test it first. I might not be back with anything until later tomorrow CDST U.S.A.

  22. #22
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Removal of Duplicates reading /invalid rows

    Hi,

    I think this is a regional settings issue rather than a version issue. The suggested formulas work with dd/mm/yyyy settings. Text to columns does not appear to work on those dates if you have US settings unless you split the time portion out into a separate column at the same time.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  23. #23
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Removal of Duplicates reading /invalid rows

    @ xlnitwit,

    Thank you. RE: Systems settings -- That is what Trevor_S back at "Cavalry" seems to think as well and has provided a link in that post (link below).

    Stripping the times out as you describe might be not be doable for the OP. Apparently this is some kind of continuous updated data feed ... I think. Maybe something like LEFT(date-time,6)&mid(c2,7,2)+2000 will do the trick.

    https://www.excelforum.com/the-water...ml#post4629074

    I'll be checking all this out.

  24. #24
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Removal of Duplicates reading /invalid rows

    Ravi_Kadu it seems there could be more than one issue at work.

    Try this link. Apparently this is a common issue with text dates.

    https://support.office.com/en-gb/art...4-14c4f124876e

  25. #25
    Registered User
    Join Date
    12-17-2016
    Location
    South Wales
    MS-Off Ver
    Excel 2007, 2016
    Posts
    68

    Re: Removal of Duplicates reading /invalid rows

    If the only issue with the solution in post #14 is the need to copy and paste values from "temporary" columns X and Y back to columns C and D, could the array formula given in post #2 be amended to refer to columns X and Y, rather than C and D?
    Any update to dates in C and D would be automatically reflected in X and Y, plus the array formulae.
    Last edited by Trevor_S; 04-17-2017 at 06:41 PM.

  26. #26
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Removal of Duplicates reading /invalid rows

    @ Trevor_S

    Good thought. We'll see what the OP feedback is.

  27. #27
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Any update on this

  28. #28
    Registered User
    Join Date
    12-17-2016
    Location
    South Wales
    MS-Off Ver
    Excel 2007, 2016
    Posts
    68

    Re: Removal of Duplicates reading /invalid rows

    Have you tried my suggestion in #25 yet?

    Looking back at the two formula by @kvsrinivasamurthy in post #2, the first one shouldn't need to be changed, as it doesn't refer to columns C or D.

    The second formula refers to ranges in columns C to G. I don't know if these can be split, so it may be easier to replicate the values of columns E to G in columns Z to AB. Enter the following formula, and copy down:
    • In cell Z1, use formula =E1
    • In cell AA1, use formula =F1
    • In cell AB1, use formula =G1
    Copy these three formulae down.

    The second array formula should then be:
    Please Login or Register  to view this content.
    Remember to enter/copy the array formulae as described in post #2.

  29. #29
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Sir,
    I tried as per your instructions, but it's not working, can you please try the same at your end and revert with attachment, if it's working.
    - Ravi

  30. #30
    Registered User
    Join Date
    12-17-2016
    Location
    South Wales
    MS-Off Ver
    Excel 2007, 2016
    Posts
    68

    Re: Removal of Duplicates reading /invalid rows

    I have tried, but its not working for me either. The original formula did work for me though - presumably due to different date settings?

    Unfortunately, I do not understand the array formula. I simply noticed that it referred to a range covering columns C-G, so re-wrote it amending the column references to the new columns created. But perhaps there's something else that needs to be done to the array formula.

    Perhaps someone with a better understanding of array formulas will see this and be able to advise.

    The other possibility is could you check (and possibly change) your date settings? It seems to be working fine for some posters to this thread, but not for others. I've taken a screen shot of my format date screen, in case this gives any help - if there are any other settings that it may be useful to compare, let me know. I've also attached a copy of the file with my amendments to it, in case this is of use to anyone that can help with the array formulae.

    Sorry that its not a solution, but hopefully its a step closer!

    Trevor


    (Using Excel 2007 on Windows 8.1)
    Attached Images Attached Images
    Attached Files Attached Files

  31. #31
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Sir,

    For me appearing out put is blank (like Post# IMG with blank output)

    - Ravi

  32. #32
    Registered User
    Join Date
    12-17-2016
    Location
    South Wales
    MS-Off Ver
    Excel 2007, 2016
    Posts
    68

    Re: Removal of Duplicates reading /invalid rows

    Same for me, after my changes. I uploaded it as I thought that it may help someone who understands array formulae better than me see what is wrong. I had thought that it would just be a case of taking the formula from the earlier post and amending the column references, but it seems that there must be more to it than that.

    However,the earlier version of the spreadsheet (before adding columns X:AB) did work for me. I'm still convinced that the reason that it doesn't for you and some other posters is due to date settings. This is why I added the screen picture, so that you would be able to see if settings differed.

  33. #33
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Can any one help me to resolve it. Thank you for your help in advance
    - Ravi

  34. #34
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Can any one help me to resolve it. Thank you for your help in advance
    - Ravi

  35. #35
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,175

    Re: Removal of Duplicates reading /invalid rows

    Please post your latest file, explaining outstanding problem.

  36. #36
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Removal of Duplicates reading /invalid rows

    Hi,

    Does this one work with your settings?
    Attached Files Attached Files

  37. #37
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Not working

    Values are appearing before clicking on ENABLE_EDITING,
    After clicking on ENABLE_EDITING the values are disappearing

    Please ref. to attached images for details.

    - Ravi

  38. #38
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Removal of Duplicates reading /invalid rows

    Apologies- I only looked at the date columns. I will adjust the other three when I have a chance.

  39. #39
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Removal of Duplicates reading /invalid rows

    Perhaps this one?
    Attached Files Attached Files

  40. #40
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Sir,
    It's working , but can you extend 300 (A3:G300) rows instead of 62 as data can be flexible/variable within 300 rows..

    I tried but it's not working,please ref. attached file for the same

    - Ravi
    Attached Files Attached Files

  41. #41
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Please help me to resolve it. Thank you for your help in advance
    - Ravi

  42. #42
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,175

    Re: Removal of Duplicates reading /invalid rows

    Just use "Find and Replace"

    Find: $A$62

    Replace: $A$300

    Replace All

  43. #43
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    As instructed ..
    Replaced all $A$62 with $A$300

    However, it's not working (result appearing blank)

  44. #44
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Removal of Duplicates reading /invalid rows

    In Name Manager you will need to adjust the Dates1 range to extend to $C$300 rather than only $C$62.

  45. #45
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Both the changes done, but it's not working (result same ; appearing blank) and diff is #VALUE!
    (ref. attached file with said changes)
    Attached Files Attached Files

  46. #46
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Removal of Duplicates reading /invalid rows

    You missed updating one range reference and the RealDates1 and RealDates2 ranges need updating to address the blank cells.

    Formulas in column U need updating to
    =IFERROR(INDEX($C$3:$G$300,SMALL(IF(IF(($A$3:$A$300=$R3),RealDates1,"")=SMALL(IF((($A$3:$A$300=$R3)*RealDates1),RealDates1,""),1),ROW($A$3:$A$300),""),1)-ROW($C$3)+1,MATCH(U$2,$C$2:$G$2,0)),"")
    Formulas in column V to
    =IFERROR(INDEX($C$3:$G$300,SMALL(IF(IF(($A$3:$A$300=$R3),RealDates1,"")=SMALL(IF((($A$3:$A$300=$R3)*RealDates1),RealDates1,""),1),ROW($A$3:$A$300),""),1)-ROW($C$3)+1,MATCH(V$2,$C$2:$G$2,0)),"")

    RealDates1 named range needs changing to
    =IF(Dates1="",0,DATE(MID(Dates1,7,2)+2000,MID(Dates1,4,2),LEFT(Dates1,2))+RIGHT(Dates1,5))
    and RealDates2 to
    =IF(Dates2="",0,DATE(MID(Dates2,7,2)+2000,MID(Dates2,4,2),LEFT(Dates2,2))+RIGHT(Dates2,5))

  47. #47
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,175

    Re: Removal of Duplicates reading /invalid rows

    This works for me.

    in S3 and copy across

    =IFERROR(INDEX($C$3:$F$300,SMALL(IF($A$3:$A$300=$R3,ROW($A$3:$A$300)-ROW($A$3)+1,""),COUNTIF($A$3:$A$300,$R3)),MATCH(S$2,$C$2:$G$2,0)),"")

    There is no logical reason why it does not work for you (if this is the case). The dates/times are standard Excel format.
    Attached Files Attached Files
    Last edited by JohnTopley; 05-18-2017 at 07:43 AM.

  48. #48
    Registered User
    Join Date
    03-15-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    96

    Re: Removal of Duplicates reading /invalid rows

    Thanks a lot sir,

    It Working for me also.
    - Ravi

+ 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. Macro button to collect data from 2 columns of unknown length & duplicates removal
    By regresss in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-29-2015, 05:30 PM
  2. [SOLVED] Remove Duplicates from both sheets reading Col B+C
    By analystbank in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-29-2015, 05:32 AM
  3. Dynamic removal of duplicates
    By spoursy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-11-2014, 01:56 PM
  4. [SOLVED] Remove Duplicates, Partial Removal
    By DorianGrim in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-14-2013, 03:16 PM
  5. [SOLVED] Removal of duplicates, with conditions.
    By Rob8489 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-07-2013, 10:07 AM
  6. Replies: 1
    Last Post: 01-20-2012, 07:17 AM
  7. Complete removal of duplicates?
    By dan hs in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 11-10-2009, 07:03 AM

Tags for this Thread

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