Results 1 to 5 of 5

Compile Numerical data based on Keywords in a Sentence

Threaded View

  1. #1
    Registered User
    Join Date
    12-27-2013
    Location
    Miami, Florida
    MS-Off Ver
    Excel 2013
    Posts
    14

    Compile Numerical data based on Keywords in a Sentence

    Hello,

    I am looking for VBA code that will allow me to:

    1) Import a .log file into excel.
    2) Look for key words in a line of text.
    a) The lines of text I am interested in will all have the pattern: X purchases the Y for Z dollars of his allowance.
    3) If the key words are in a line of text, extract the number within that same line of text.
    4) Create a category for the subject of that line of text.
    5) Add the number within the line of text to two separate cells:
    a) To one cell that tracks the total spent for the subject of that line of text.
    b) To one cell that keeps a running total for the entire document.


    Example of a typical .log file is as follows:

    The store opened on Tuesday afternoon.
    Dexter purchases the Vase for 8 dollars of his allowance.
    Ralph purchases the Vase for 7 dollars of his allowance.
    The store closed on Sunday morning.
    The store opened on Monday evening.
    Carl purchases the Vase for 6 dollars of his allowance.
    Jim purchases the Vase for 8 dollars of his allowance.
    Ralph purchases the Vase for 10 dollars of his allowance.
    The store closed on Wednesday afternoon.
    The store opened on Thursday evening.
    Ralph purchased the Vase for 11 dollars of his allowance.
    Carl purchases the Vase for 7 dollars of his allowance.

    I would need Categories that show the following data from the text above:
    Dexter = 8
    Ralph = 28
    Carl = 13
    Jim = 8
    Total store profit = 57

    Thanks in advance
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. automatic sorting names based on numerical data
    By Littlesimon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-18-2015, 11:46 PM
  2. Automatic sorting names based on numerical data
    By Littlesimon in forum Excel General
    Replies: 5
    Last Post: 01-15-2015, 05:45 PM
  3. [SOLVED] HDI - Return multiple keywords in a text column based on a set of available keywords
    By zneiley in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-25-2013, 01:32 PM
  4. Trying To Write A Complete Sentence Based On Columnar Data
    By Godzilla in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2008, 10:50 PM
  5. Numerical error in IF-sentence
    By MnO in forum Excel General
    Replies: 2
    Last Post: 12-06-2006, 10:37 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