+ Reply to Thread
Results 1 to 7 of 7

Sum cells after applying a formula

Hybrid View

  1. #1
    Registered User
    Join Date
    05-05-2010
    Location
    Rotterdam, Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    22

    Sum cells after applying a formula

    Hello everybody,

    Probably really basic but this is not working for me.

    I have a column (A) which has two elements in each cell, the # (number) of bookings and the total amount of hours.
    Each cell looks like this:

    (1) 4.00
    (5) 3.33
    (19) 54.50
    (30) 75.25
    I wanted to separate the two values and I manage to do it (probably in a really complicated way, but it works).
    After transformation everything looks like this:

    original	#	Time (h)
    (1) 4.00	(1)	 4.00
    (5) 3.33	(5)	 3.33
    (19) 54.50	(19)	 54.50
    (30) 75.25	(30)	 75.25
    The formulas used were:
    =IF(ISTEXT(A2),LEFT(A2,SEARCH(")",A2)),"")
    =IF(ISTEXT(A2),RIGHT(A2,LEN(A2)-SEARCH(")",A2)),"")

    My problem now is that the total amount of hours is not recognized as number and I can not make basic functions like sum on these cells.
    Could anyone look at this and let me know how I can solve it?

    The attached file has an example where you can work on.

    Thank you all in advance,
    Joćo
    Attached Files Attached Files

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Sum cells after applying a formula

    perhaps
    =IF(ISTEXT(A2),--RIGHT(A2,LEN(A2)-SEARCH(")",A2)),"")
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    05-05-2010
    Location
    Rotterdam, Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Sum cells after applying a formula

    Whoooaaa...

    Works perfectly. Can you explain me the rationale behind it?
    Also, is there any other way to do it without changing the formulas (that will be a pain for my entire workbook). Maybe on the cell properties?

    Cheers

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Sum cells after applying a formula

    you either have to change that formula or the sum formula

    the -- simply coerces the text to a true numeric value (you can use other math operations such as +0, *1 etc)

  5. #5
    Registered User
    Join Date
    05-05-2010
    Location
    Rotterdam, Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Sum cells after applying a formula

    And how would I change the formula to accept the cells as numbers?

    I played really quickly now and I know if I do =SUM(--B3) this will transform that cell into a number. But If I use =SUM(--B3:B5) this will give an error.
    If there is no other way I guess I will have to change the formulas across the workbook.

    Cheers and thanks again.

  6. #6
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Sum cells after applying a formula

    This will sum the entire range in a single cell

    =SUMPRODUCT(--RIGHT(A2:A21,LEN(A2:A21)-SEARCH(")",A2:A21)))
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  7. #7
    Registered User
    Join Date
    05-05-2010
    Location
    Rotterdam, Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Sum cells after applying a formula

    Thank you both for the help.

    I'll add the tag Solved.

    Cheers

+ 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