+ Reply to Thread
Results 1 to 5 of 5

Counting pieces in a lump sentence

  1. #1
    Registered User
    Join Date
    11-24-2019
    Location
    Malaysia
    MS-Off Ver
    2019
    Posts
    35

    Counting pieces in a lump sentence

    Hi, i have an excel here where my colleague has been working on.
    I would like to count the quantity of each sports, but as the input was lumped together in an example sentence "basketball = 3 pcs" in a cell.
    I am not sure exactly if vlookup or sumif can works.

    One method i can think of is by dividing the cell using "text to column" into 2 columns "basket" and "3 pcs".
    From there, use vlookup or sumif.

    But i would like to know if there are other faster methods that can works too.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Counting pieces in a lump sentence

    If you are able to structure the date in rows instead of columns you can use pivot table.

    See the attached file for an example.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,877

    Re: Counting pieces in a lump sentence

    Here is a solution using Power Query/Get and Transform

    Please Login or Register  to view this content.
    Excel 2016 (Windows) 32 bit
    A
    B
    1
    Value.1 Count
    2
    Balloon
    10
    3
    Basketball
    14
    4
    IWD
    2
    5
    Softball
    2
    6
    Tennis
    7
    Sheet: Sheet2

    Review PQ
    In the attached file
    Click on any cell in the new table
    On the Data Tab, click on Queries & Connections
    In the right window, double click to open Query
    Review PQ steps

    M-code basics:
    - "let" is the start of a query
    - "in" is the closing of a query
    - each transformation step sits in between those 2 lines
    - each step line is ended by a comma, except the last one
    - "Source" is always the first step (Source Data)
    - After "in" you have the last step referenced
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    11-24-2019
    Location
    Malaysia
    MS-Off Ver
    2019
    Posts
    35

    Re: Counting pieces in a lump sentence

    Quote Originally Posted by alansidman View Post
    Here is a solution using Power Query/Get and Transform

    Please Login or Register  to view this content.
    Excel 2016 (Windows) 32 bit
    A
    B
    1
    Value.1 Count
    2
    Balloon
    10
    3
    Basketball
    14
    4
    IWD
    2
    5
    Softball
    2
    6
    Tennis
    7
    Sheet: Sheet2

    Review PQ
    In the attached file
    Click on any cell in the new table
    On the Data Tab, click on Queries & Connections
    In the right window, double click to open Query
    Review PQ steps

    M-code basics:
    - "let" is the start of a query
    - "in" is the closing of a query
    - each transformation step sits in between those 2 lines
    - each step line is ended by a comma, except the last one
    - "Source" is always the first step (Source Data)
    - After "in" you have the last step referenced
    This is what i need, thank you.
    Today i learn something "power query".

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,877

    Re: Counting pieces in a lump sentence

    Thanks for the feedback and the rep

+ 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. Cross reference letter case: Beginning of sentence and middle of sentence
    By caswell1000 in forum Word Formatting & General
    Replies: 4
    Last Post: 02-07-2019, 05:25 PM
  2. Loan with Increasing Lump Sum Payments
    By martinpgibson in forum Excel General
    Replies: 3
    Last Post: 05-12-2015, 12:37 AM
  3. Breaking lump payment by month
    By inincubus in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-31-2014, 11:23 AM
  4. Counting rows with two pieces of information
    By Mog666 in forum Excel - New Users/Basics
    Replies: 11
    Last Post: 11-25-2007, 02:27 PM
  5. How to calculate how much I can spend each year of a lump sum?
    By Phedwards in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-28-2007, 06:19 PM
  6. counting a sentence text
    By dj_siek in forum Excel General
    Replies: 2
    Last Post: 03-29-2007, 09:56 PM
  7. [SOLVED] how to compute interest for a lump sum
    By autocoder in forum Excel General
    Replies: 0
    Last Post: 01-12-2006, 04:15 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