+ Reply to Thread
Results 1 to 10 of 10

Adding components of a sum

Hybrid View

  1. #1
    Registered User
    Join Date
    05-03-2024
    Location
    UAE
    MS-Off Ver
    MS Office 365
    Posts
    5

    Adding components of a sum

    Hi - if i have a cell that has the following
    =10 + 10 + 10

    how can count the components that make up taht sum in the next cell
    For example above would be 3

    =20 + 13
    Answer 2

    =1+2+3+4+5
    Answer 5

    can i do that? thanks

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,842

    Re: Adding components of a sum

    Try this:

    =LEN(A1) - SUBSTITUTE(A1&"+","+","")

    Hope this helps.

    Pete

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Adding components of a sum

    If formula is in cell A1
    Cell B1:
    =LEN(FORMULATEXT(A1))-LEN(SUBSTITUTE(FORMULATEXT(A1),"+",""))+1
    Quang PT

  4. #4
    Registered User
    Join Date
    05-03-2024
    Location
    UAE
    MS-Off Ver
    MS Office 365
    Posts
    5

    Re: Adding components of a sum

    Yes that works!!! Amazing thank you!!

  5. #5
    Registered User
    Join Date
    05-03-2024
    Location
    UAE
    MS-Off Ver
    MS Office 365
    Posts
    5

    Re: Adding components of a sum

    Quote Originally Posted by bebo021999 View Post
    If formula is in cell A1
    Cell B1:
    =LEN(FORMULATEXT(A1))-LEN(SUBSTITUTE(FORMULATEXT(A1),"+",""))+1
    Yes that works!!! Amazing thank you!!

  6. #6
    Registered User
    Join Date
    05-03-2024
    Location
    UAE
    MS-Off Ver
    MS Office 365
    Posts
    5

    Re: Adding components of a sum

    And can i ask if the A1 cells had no components i want it to leave blank.... is that possible?

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,932

    Re: Adding components of a sum

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Adding components of a sum

    First of all, could you confirm which one works? #2 or #3?

  9. #9
    Registered User
    Join Date
    05-03-2024
    Location
    UAE
    MS-Off Ver
    MS Office 365
    Posts
    5

    Re: Adding components of a sum

    Quote Originally Posted by bebo021999 View Post
    First of all, could you confirm which one works? #2 or #3?
    you your solution works - thank you -

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,932

    Re: Adding components of a sum

    For either formula:

    =IF(A1="","",formula)

+ 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. adding components to charts and tables
    By pkobzar in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 02-14-2020, 01:09 PM
  2. Incrementing while adding cell components to formula
    By sirdeity in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 03-27-2011, 01:50 AM
  3. Taking data from 3 different cells and adding the components toget
    By Mangesh Yadav in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2005, 04:05 AM
  4. Taking data from 3 different cells and adding the components toget
    By Dubbs in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. Taking data from 3 different cells and adding the components toget
    By Dubbs in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  6. [SOLVED] Taking data from 3 different cells and adding the components toget
    By Dubbs in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  7. Taking data from 3 different cells and adding the components toget
    By Dubbs in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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