+ Reply to Thread
Results 1 to 11 of 11

Checking of cells with other cells (text)

  1. #1
    Registered User
    Join Date
    04-12-2016
    Location
    SG
    MS-Off Ver
    2010
    Posts
    6

    Checking of cells with other cells (text)

    Hi all, have an interesting problem that I hope excel will be able to help with.

    Situation
    I conduct tests for people, and one of these test requires people to list as many words as they can in a certain category, say "Clothing". As there are often many synonyms (e.g. Trousers & Pants; Jumper & Sweater), we have a spreadsheet where we list what are acceptable words, and their synonyms. However, it takes much time to manually go through this spreadsheet to check for synonyms, for a list of 20-odd items.

    Solution request
    Would it be possible to have excel make this process easier? Perhaps an area in which the list of items may be entered, with synonyms being automatically detected and then flagged. A similar idea is the identification of Duplicate Values, although in my case I will need to identify text values that seemingly have nothing in common, save for their semantic meaning (Sweater vs Jumper). As mentioned, there is a spreadsheet of synonyms already, so it can serve as a source point of reference for the automated checker.

    Due to organizational security, it would be best if this could also be done with just conditional formatting, without the use of VBAs or macros.

    Hoping to hear everyone's thoughts on this, even if you think this is flat-out impossible!

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,626

    Re: Checking of cells with other cells (text)

    Not seeing data layout (and especially synonyms spreadsheet) is not so easy to suggest particular method. Could be that simple index-match solution and counting unique values would do.

    Moreover you mentioned conditional formatting - it will be visible as soon as first words are entered
    how about misspeled words like swaeter, junper ;-) etc.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    04-12-2016
    Location
    SG
    MS-Off Ver
    2010
    Posts
    6

    Re: Checking of cells with other cells (text)

    Thanks for you reply!!

    I'm open to modifying the layout of the synonym spreadsheet, as I would like it to support whichever system is used for the auto-check.

    For now, what we have is a very simple spreadsheet that has a list of words, and synonyms side by side. Something like this: (can't seem to attach a sample file here :/)

    Accepted words <------> Synoynms
    Shirt <------> Long Sleeved Shirt, Short Sleeved Shirt
    Trousers <------> Pants
    Pants <------> Trousers
    T Shirt
    Long sleeved Shirt <------> Shirt
    Short sleeved Shirt <------> Shirt
    Bermudas
    Dress


    No need to worry about misspelling as well, we are able to check for spelling as we record the words down.
    Last edited by X-L; 04-12-2016 at 10:20 PM. Reason: formatting screw ups

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,626

    Re: Checking of cells with other cells (text)

    I'd go for VBA, but if you want to avoid this, and as you said in post #1 flag with conditional formatting, consider conditional formatting with a rule based on a formula.

    example formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    it calls for different arrangement of synonyms/acceptable words table - see second sheet:
    HTML Code: 
    note that the formatting is applied at the moment in column A (rows 2:21) other columns are just description to the sample and could be deleted
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-12-2016
    Location
    SG
    MS-Off Ver
    2010
    Posts
    6

    Re: Checking of cells with other cells (text)

    Thanks, this looks like it could work!

    Just to make sure I understand it correctly:
    - Essentially we're assigning a unique number to the different items, with synonyms getting the same numbers.
    - The formula you've given then checks this unique number to see if there are any duplicates within the list of items.
    - Any duplicates are highlighted.

    Is that right?

    I hope this isn't too much trouble as well, but could you explain some of the formula as well? I understand what the functions do individually, but I'm not sure how they work together in this case. Specifically I'm confused by -

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Why is the TRANSPOSE function necessary, and what exactly is it doing here? it looks like it is comparing the preceding items to the items in the Acceptable worksheet, but I'm not sure.

    Thanks very much for your help!

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,626

    Re: Checking of cells with other cells (text)

    Hi,
    the formula works opposite way, it highlights unique values (duplicates stay untouched). To highlight duplicates it should be negated.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    As you noted first vlookup just checks if a word is anywhere on a list (could use here MATCH as well, but the same formula is used also in second part). So it it is listed - returns a synonyms group number if not returns error resulting in no CF appled in that cell

    As for:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    the innermost part is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    as we copy it down it becomes
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and so on.
    so the output is a table 8 rows (1:8) by n columns
    we do transpose to change A1:An rows into columns
    the table contains comparisons of A1...An values with allowed item names.
    Then we have IF ariound it:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    is comparison is true the position in table is substituted with "number of synonyms group" else it is substituted with empty string
    then we compare number of group for text entered (A2) with every item in a table
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and result is table of boolean values true/false
    so we convert these values to numbers using just
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and sum all these numbers with simple
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If there was any item from the same synonyms group in cells above, the sum will be non-zero, wile if it is first occurence of given group the sum is 0.

    Now we do negation (so the number is now treatred as boolean value - if 0 then treated as false , any other number treated as true) and negated true is false (of course negated false is true)
    We multiply this (so again true becomes 1 and false 0) by te Vlookup from the front and here we are

    ... writing this (still probably not very descriptive text) took me (i think) some 20 times longer than writing the formula :-D

    Note that in transpose(A$1:An) we start from the cell not containing any word expected. we could start from A2 but then we shall have separate conditional formatting for cell A2 and other for all next cells, so I did it that way to have just one universal formula.

    Hope it clears view a bit
    Last edited by Kaper; 04-14-2016 at 03:04 AM.

  7. #7
    Registered User
    Join Date
    04-12-2016
    Location
    SG
    MS-Off Ver
    2010
    Posts
    6

    Re: Checking of cells with other cells (text)

    Hi Kaper,

    Thank you so very much for the explanation. I still have some questions about some parts of the equation, but perhaps we can go into detail later.

    For now, I think you've provided what I was hoping to find, so thanks very much! "Long-sleeved shirt" and "short-sleeved shirt" are currently considered as synonyms though. Is it possible for them to be counted as two separate items, but still have them as synonyms of "shirt"?

    Thanks so much again!

  8. #8
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,626

    Re: Checking of cells with other cells (text)

    I do not think it possible with this approach. Being synonym is non-herarhical.

    If A is synonym of B then automatically B is synonym of A.

    This what you described is rather taxonomy
    cat is a mammal
    dog is a mammal
    but dog is not cat

  9. #9
    Registered User
    Join Date
    04-12-2016
    Location
    SG
    MS-Off Ver
    2010
    Posts
    6

    Re: Checking of cells with other cells (text)

    I see. Is excel able to sort information in this manner then?

  10. #10
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,626

    Re: Checking of cells with other cells (text)

    Basically - yes (not with such ease as synonyms), but it is already pretty far from the place where we started:
    I conduct tests for people, and one of these test requires people to list as many words as they can in a certain category, say "Clothing". As there are often many synonyms (e.g. Trousers & Pants; Jumper & Sweater), we have a spreadsheet where we list what are acceptable words, and their synonyms. However, it takes much time to manually go through this spreadsheet to check for synonyms, for a list of 20-odd items.
    So if your opening question is answered, I'd suggest marking thread solved and possibly start new one, keeping in mind how usefull the attachment could be

  11. #11
    Registered User
    Join Date
    04-12-2016
    Location
    SG
    MS-Off Ver
    2010
    Posts
    6

    Re: Checking of cells with other cells (text)

    Great, will do. Thanks so much for your help, I really appreciate it!

+ 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. [SOLVED] Nested If statement, checking multiple cells for Blank cells
    By JLeague in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-30-2015, 11:18 AM
  2. Checking text in cells against a list of possible words
    By robcmar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-27-2013, 04:20 PM
  3. [SOLVED] how to modify code from checking all cells to range of cells
    By behnam in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-03-2013, 11:16 AM
  4. Checking cells for 2 text strings
    By Phillycheese5 in forum Excel General
    Replies: 4
    Last Post: 10-04-2010, 10:25 AM
  5. Checking multiple cells for text.
    By matt20687 in forum Excel General
    Replies: 5
    Last Post: 07-16-2010, 06:55 PM
  6. Checking two cells for text, returning one value
    By sdaddy in forum Excel General
    Replies: 4
    Last Post: 06-09-2009, 02:49 AM
  7. Checking text across a range of cells
    By thebluemask in forum Excel General
    Replies: 4
    Last Post: 10-09-2008, 06:34 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