+ Reply to Thread
Results 1 to 9 of 9

Multiple terms in same cell?

Hybrid View

ml20080424 Multiple terms in same cell? 04-24-2008, 01:27 PM
shg You can enter =3*A + 2*B, and... 04-24-2008, 01:39 PM
ml20080424 I'm trying to avoid putting... 04-25-2008, 07:57 PM
shg I've lost the bubble on what... 04-25-2008, 08:07 PM
ml20080424 I am collecting data for... 04-28-2008, 08:17 PM
  1. #1
    Registered User
    Join Date
    04-24-2008
    Posts
    6

    Multiple terms in same cell?

    Hello,

    I am wondering if it is possible to enter two or more summable terms in the same cell. For example, if I entered "3A + 2B" in a cell, I would like Excel to be able to sum these two terms as "5", but still be able to retrieve information about how many "A"s and "B"s there are in the cell. Does anyone know of a way to do this? Glad to clarify if needed.

    Matthew
    Last edited by shg; 04-24-2008 at 01:36 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    You can enter =3*A + 2*B, and define A and B as constants both equal to 1: Insert > Name > Define, A Refers to: =1

    What are you trying to do and why?

  3. #3
    Registered User
    Join Date
    04-24-2008
    Posts
    6
    I'm trying to avoid putting too many columns in a file I'm working on. By the way, I should have mentioned that I'm using 2007.

    Your suggestion worked (although, in Excel 2007, the "Define Name" command is in the "Formulas" tab), but I would also like to be able to sum only the terms that I choose; i.e., only the number of "A"s, "B"s or other terms. Is there any way to use the sum function (or another function) to do this?

    Thanks

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    I've lost the bubble on what you're trying to do and why.

    The numbers of A's in a string is =len(a1) - len(substitute(a1, "A", ""))

    You could assign names (A, B, ...) to cells and change the values to count only the terms you want.
    Last edited by shg; 04-25-2008 at 08:09 PM.

  5. #5
    Registered User
    Join Date
    04-24-2008
    Posts
    6
    Quote Originally Posted by shg
    I've lost the bubble on what you're trying to do and why.
    I am collecting data for certain categories of services. Many of these categories can be divided up into smaller subcategories, but I would like to avoid having to make separate columns for each subcategory. Instead, I want to assign the subcategories values of "A", "B" etc., and enter them into a single cell for each service date (thus: 5*A + 6*B + ... for any given date). You have shown me how to do this, but now I would like to know how to track the sum of the categories and subcategories as needed.

    For example, given 5*A + 6*B in one cell and 6*A + 7*B in another cell, I want to be able to sum only the terms with A (giving 11) or only those with B (giving 12). The regular sum function recognizes only the total in each cell, as far as I can see.

    Does that help to clarify?

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    So back to my prior suggestion: Create named cells, A, B, C, ...

    Set the values of the cells you want to count to 1, and those you don't to zero.

    BTW, I'd recommend against doing what you're doing.
    Last edited by shg; 04-28-2008 at 09:11 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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