+ Reply to Thread
Results 1 to 15 of 15

Comparing data in rows in multiple columns?

  1. #1
    Registered User
    Join Date
    02-28-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    12

    Question Comparing data in rows in multiple columns?

    Hi all,
    I am working on a project where I’m trying to identify similar assets that can be destroyed or digitised. I am basically trying to compare the date in rows within the same column and then do the same for multiple columns. If all match then highlight the rows.

    Please see below a sample example of my data(please see attached)

    I’m trying to work on a formula that would do the following :

    It title column B in a row is the same
    Is Ep# I column L n a row is same
    If medium column D in a row is same
    If element type column f in a row is same
    If version column G in a row is same
    If standard column I in a row is same
    If AR/ audio Config column H is same
    Then colour rows yellow

    Or if all cells in rows in the following columns B, L, D, F, G, I, H match than colour yellow.

    And then
    If colour of row is yellow and Size format column E contains text “DAT”, place text “Destroy” in Recommendation Column T.

    Any help or ideas would be very much appreciated. Thank you in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,301

    Re: Comparing data in rows in multiple columns?

    You need helper cells.

    In V2, enter the formula

    = B2& L2& D2& F2& G2& I2& H2

    Then in T2, enter

    =IF(COUNTIF($V$1:V2,V2)>1,IF(NOT(ISERROR(FIND("DAT",E2))),"Destroy",""),"")

    And copy both down to match your data. Note that your example file did not have any rows that met your criteria for "Destroy"....


    Then Select cells A2:T??? and use Conditional formatting with the formula option, using the formula

    =$V2 = "Destroy"

    and choose the yellow fill.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,747

    Re: Comparing data in rows in multiple columns?

    @ Bernie Deitrick

    Good one. Shouldn't the >1 be >=1 ? I'm assuming it's a 'typo'.
    Dave

  4. #4
    Registered User
    Join Date
    02-28-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Comparing data in rows in multiple columns?

    Thank you so very much for your help.
    And thank you for pointing out I have not included two similar entries. Apologies as was unclear in my criteria. What I need to do is compare the data within the rolls in columns B, L, D, F, G, I, H and mark them as duplicate instead of Destroy. So the two rows highlighted in blues should be the ones that come up as duplicate. And only then as a second rule if Colum E contains certain text such as DAT it is Marked as Destroy. Hope this makes sense. I’ve attached an example of how it should look like once applied.
    Thank you again for all your help., it is very much appreciated.
    Last edited by inso; 08-20-2015 at 05:42 AM.

  5. #5
    Registered User
    Join Date
    02-28-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Comparing data in rows in multiple columns?

    Attachment below.
    Attached Files Attached Files
    Last edited by inso; 08-20-2015 at 05:46 AM.

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,301

    Re: Comparing data in rows in multiple columns?

    No, COUNTIF will always return 1 if you include the criteria cell in the range, and duplicates are when the result from COUNTIF is >1 (2, 3, 4, etc.)

  7. #7
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,301

    Re: Comparing data in rows in multiple columns?

    Maybe use this in T2, instead:

    =IF(COUNTIF(V:V,V2)>1,IF(NOT(ISERROR(FIND("DAT",E2))),"Destroy","Duplicate"),"")

    and use this for the CF

    =OR($V2 = "Destroy", $V2 = "Duplicate")

  8. #8
    Registered User
    Join Date
    02-28-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Comparing data in rows in multiple columns?

    Many thanks Bernie Deitrick! You are an absolute saviour!
    Just one final question if I want to say add DVD-R to the Destroy (using multiple criteria)can I input it in the same formula something like: =IF(COUNTIF(V:V,V2)>1,IF(AND(NOT(ISERROR(FIND("DAT",E2))),"Destroy","Duplicate"),(NOT(ISERROR(FIND("DVD-R",E2))),"Destroy","Duplicate"),"")
    My syntax or my logic is defiantly wrong here so your input is truly appreciated as always.

  9. #9
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,301

    Re: Comparing data in rows in multiple columns?

    Here you go:

    =IF(COUNTIF(V:V,V2)>1,IF(NOT(ISERROR(FIND("DAT",E2))),"Destroy",IF(NOT(ISERROR(FIND("DVD-R",E2))),"Destroy","Duplicate")),"")

    Just be careful when you actually destroy things - do them one at a time, because this will flag both of the duplicates as "Destroy", but getting rid of one will unflag the other.
    Last edited by Bernie Deitrick; 08-20-2015 at 11:38 AM.

  10. #10
    Registered User
    Join Date
    02-28-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Comparing data in rows in multiple columns?

    Brilliant you are absolutely amazing! Thank you again.

  11. #11
    Registered User
    Join Date
    02-28-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Comparing data in rows in multiple columns?

    Apologies but one final addition as I spotted I've omitted this, column A Elem # has to be different values for the entire formula to work. For example if element 252290 is in two rows than the rows cannot be duplicates, if however its two different ones like 254875 and 254874 and all other columns are the same then these can be marked as duplicates(please see attached). A bit of reverse logic so hope I've explained it ok . Apologies if I am confusing.
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,301

    Re: Comparing data in rows in multiple columns?

    You could also use this, which may be easier to expand in the future by copying the bolded section and pasting it just after the bolded part and changing the criteria string

    =IF(COUNTIF(V:V,V2)>1,IF(OR(NOT(ISERROR(FIND("DAT",E2))),NOT(ISERROR(FIND("DVD-R",E2)))),"Destroy","Duplicate"),"")

    =IF(COUNTIF(V:V,V2)>1,IF(OR(NOT(ISERROR(FIND("DAT",E2))),NOT(ISERROR(FIND("DVD-R",E2))),NOT(ISERROR(FIND("Other",E2)))),"Destroy","Duplicate"),"")

  13. #13
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,301

    Re: Comparing data in rows in multiple columns?

    Should row 6 be flagged, since it is a duplicate of both rows 8 and 9? And should 8 and 9 be flagged because of their match with row 6 (but since A8 and A9 match, maybe they should not)? Note that if either 8 or 9 were removed, the other would be flagged as a duplicate because of row 6, as would 6....

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

    Re: Comparing data in rows in multiple columns?

    Quote Originally Posted by Bernie Deitrick View Post
    No, COUNTIF will always return 1 if you include the criteria cell in the range, and duplicates are when the result from COUNTIF is >1 (2, 3, 4, etc.)
    I am assuming that is directed at my post. Seems I misinterpreted what the final target was. DAT doesn't seem to be a target.

  15. #15
    Registered User
    Join Date
    02-28-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Comparing data in rows in multiple columns?

    Cheers so much, you are absolutely correct row 6 should be flagged up as well. Many thanks you have truly helped me a lot!

+ 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. Comparing Data on Multiple Sheets and Columns
    By ande2428 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-06-2014, 10:33 AM
  2. Comparing two columns-multiple rows
    By chs in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-31-2012, 05:56 PM
  3. Align rows comparing multiple columns
    By cinti07 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-15-2012, 06:11 AM
  4. Comparing two columns data and inserting rows
    By scyllanbay in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-11-2012, 11:56 AM
  5. Comparing data across multiple columns
    By jigabug in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-29-2010, 08:10 PM
  6. Align Rows Comparing Multiple Columns
    By deaerator in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-19-2008, 11:13 AM
  7. Comparing data in multiple columns
    By sammyd323 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-24-2007, 11:54 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