Results 1 to 3 of 3

Trying To Write A Complete Sentence Based On Columnar Data

Threaded View

  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

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