+ Reply to Thread
Results 1 to 3 of 3

Can I have Excel automatically detect text and add the number to the right of it

  1. #1
    Registered User
    Join Date
    01-14-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2013
    Posts
    12

    Can I have Excel automatically detect text and add the number to the right of it

    I'm making an itemized list of everything I buy for the month. My spreadsheet shows a label in the left cell and the cost of the label to the right of it. Like this:

    Please Login or Register  to view this content.
    So I want Excel to detect the text "Junk Food" from A1, A2, and A4 and automatically add it's corresponding cost (From B1, B2, B4) into B6. This way I won't have to enter "=sum(" then manually click Ctrl + B1, B2, and B4 every time I add a new item of Junk Food. I want the output of A6 to only show how much I spent on Junk food.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Can I have Excel automatically detect text and add the number to the right of it

    Try the SUMIF function..
    =SUMIF(A1:A6,"Junk Food",B1:B6)

    You can also use a cell reference for junk food
    =SUMIF(A1:A6,C1,B1:B6)
    C1 = Junk Food

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Can I have Excel automatically detect text and add the number to the right of it

    Using your posted data...
    AND
    A10: a category to summarize....Junk Food
    This regular formula returns the total for that category
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    01-14-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2013
    Posts
    12

    Re: Can I have Excel automatically detect text and add the number to the right of it

    Great those both worked perfectly. Thank you.

+ 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] I want my excel spreadsheet to automatically detect when a new file is placed in a
    By dtaganovic16 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 08-27-2012, 02:50 PM
  2. Need Excel detect and calculate the trades automatically
    By shippingkongen in forum Excel General
    Replies: 4
    Last Post: 06-01-2010, 02:27 PM
  3. Replies: 2
    Last Post: 08-23-2009, 05:39 AM
  4. automatically detect excel file in designated directory and convert to pdf
    By brucelim80 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-28-2006, 10:04 PM
  5. [SOLVED] How to avoid excel automatically detect the cells formatl???
    By filo666 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2005, 01:05 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