+ Reply to Thread
Results 1 to 3 of 3

Trying To Write A Complete Sentence Based On Columnar Data

  1. #1
    Registered User
    Join Date
    10-14-2008
    Location
    East Coast
    Posts
    2

    Trying To Write A Complete Sentence Based On Columnar Data

    Hi,

    I've been struggling with this problem myself and figured I'd turn to the collective knowledge here for help.

    I'm trying to formulate some sentences based on results of a comparison.

    I'm comparing my current car's attributes to other cars that I've entered data for. The phrases generated need to describe the differences in positive, negative and equal attributes between the 2 cars.

    I know how to concatenate text but this is a little trickier.

    For instance if there is only 1 negative "difference" and it's wheelbase, I want it to say "Negative Differences Are 10 inches less wheelbase."

    If there are 2 negative "differences" and they are wheelbase and doors, I want it to say "Negative Differences Are 10 inches less wheelbase and 2 less doors." (this inserts an 'and' between the 2 attributes).

    If there are 3 negative "differences" and they are wheelbase, doors and warranty miles, I want it to say "Negative Differences Are 10 inches less wheelbase, 2 less doors and 10000 less warranty miles." (inserting a ',' and an 'and' between the attributes).

    Repeat above scenarios with Positive and Equal attributes.

    Every car compared will obviously have it's own set of differences (positive/negative) and equalities and probably a different number of each.

    A big part of the problem is knowing when the final attribute is encountered and whether to insert a comma, an 'and', a period or nothing in the appropriate places to form a proper sentence when differences are described.

    All of the math for the differences has been done and the differences are in their respective columns....Negative / Positive / Equal columns.

    I know it's hard to describe and that's why I've attached an example spreadsheet with some example data and an expected phrase/sentence I'm trying to generate.

    The phrase I'm trying to generate is in cells B11 and B22.

    Forgot to mention I'm using Excel 2002 for this.

    Thanks for any help!
    Whew!
    Attached Files Attached Files
    Last edited by Godzilla; 10-14-2008 at 10:29 PM. Reason: Added Excel Version

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    The table is more readily assimilated than the synthetic sentence. Why the exercise?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    10-14-2008
    Location
    East Coast
    Posts
    2
    Quote Originally Posted by shg View Post
    The table is more readily assimilated than the synthetic sentence. Why the exercise?
    I've been given an online form to fill out that describes the differences between 2 cars. The online form needs words. ie...I need to describe the differences in sentences.

    The spreadsheet is my way of determining the differences, instead of marking up printouts, spec sheets, etc.

    In the past, I've been formulating and typing the sentences myself from the spreadsheet tables but I want to automate the process even more by having Excel chew up the table and spit out the sentence. I will then copy and paste this info into the online form.

+ 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. Can Excel Draw Shapes or Angles based on Data?
    By chesspupil in forum Excel General
    Replies: 15
    Last Post: 04-30-2016, 03:31 PM
  2. Charts - Source Data based on Named Ranges
    By Hurricane8 in forum Excel General
    Replies: 1
    Last Post: 07-15-2008, 04:02 PM
  3. macro command based on Pivot data
    By mike703 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-03-2008, 05:17 PM
  4. Macro to filter based on identical column data as opposed to entire record
    By marielb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-27-2007, 12:27 PM
  5. locking a data validation list based upon cell value
    By abrazee in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-18-2006, 04:46 PM

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