+ Reply to Thread
Results 1 to 10 of 10

Adding numbers in a cell

  1. #1
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Adding numbers in a cell

    Good Morning,

    Trying to get a formula right from the attached spreadsheet.

    In column E I'm trying to get an automated formula from columns B,C,D

    The result I'm trying to get is:
    Initials from B, D+D, M+M from C, H+H M+M from D # Number of times name mentioned up until that row
    EG:
    In row 4
    Intiials from B = TI, D+D=8 M+M=1 from C, H+H=4, M+M=14(then again to round down to single digit=5) from D,#01
    Resulting in E4 being TI8145#01

    I've tried many formulas i've found on Google, but none of these add up to the correct numbers?
    I'm not sure if because they are in date and time formats, the : and / may be affecting the formulas?

    Any help much appreciated.

    Many thanks in advance.
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,955

    Re: Adding numbers in a cell

    Not really sure what you are trying to do here, but to get days...
    =DAY(C4)
    to add the values...
    =LEFT(DAY(C4),1)+IF(LEN(DAY(C4))>1,RIGHT(DAY(C4),1),0)

    Will work on the rest soon
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,955

    Re: Adding numbers in a cell

    for month...
    =LEFT(MONTH(C4),1)+IF(LEN(MONTH(C4))>1,RIGHT(MONTH(C4),1),0)

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,955

    Re: Adding numbers in a cell

    OK this is getting out of hand lol. For the minutes...
    =LEFT(LEFT(MINUTE(D4),1)+IF(LEN(MINUTE(D4))>1,RIGHT(MINUTE(D4),1),0),1)+IF(LEN(LEFT(MINUTE(D4),1)+IF(LEN(MINUTE(D4))>1,RIGHT(MINUTE(D4),1),0))>1,RIGHT(LEFT(MINUTE(D4),1)+IF(LEN(MINUTE(D4))>1,RIGHT(MINUTE(D4),1),0),1),0)

  5. #5
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Adding numbers in a cell

    Cool, Thankyou, great start to getting right

    Got this so far:
    =UPPER(LEFT(B4,1)&MID(B4,FIND(" ",B4&" ")+1,1))&LEFT(DAY(C4),1)+IF(LEN(DAY(C4))>1,RIGHT(DAY(C4),1),0)&LEFT(MONTH(C4),1)+IF(LEN(MONTH(C4))>1,RIGHT(MONTH(C4),1),0)&LEFT(HOUR(D4),1)+IF(LEN(HOUR(D4))>1,RIGHT(HOUR(D4),1),0)&LEFT(MINUTE(D4),1)+IF(LEN(MINUTE(D4))>1,RIGHT(MINUTE(D4),1),0)&"#"&COUNTIF(B4,B4)

    Which results in:
    TI81414#1

    Only 1 part which is not right:
    LEFT(MINUTE(D4),1)+IF(LEN(MINUTE(D4))>1,RIGHT(MINUTE(D4),1),0)

    Is there a way that if this equals a 2 digit result, the formula goes again to round down to 1 digit

    EG:
    M+M = 5+9=14, 1+4=5
    giving a formula result of: TI8145#1

    Many thanks.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,955

    Re: Adding numbers in a cell

    You already have the initials, so the rest would be...
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    which returns 8145#01

  7. #7
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Adding numbers in a cell

    Awesome

    Thankyou very much, so much appreciated.

    I've ammended this so the additional part works on all parts of the formula resulting in:
    =UPPER(LEFT(C4,1)&MID(C4,FIND(" ",C4&" ")+1,1))&LEFT(LEFT(DAY(F4),1)+IF(LEN(DAY(F4))>1,RIGHT(DAY(F4),1),0),1)+IF(LEN(LEFT(DAY(F4),1)+IF(LEN(DAY(F4))>1,RIGHT(DAY(F4),1),0))>1,RIGHT(LEFT(DAY(F4),1)+IF(LEN(DAY(F4))>1,RIGHT(DAY(F4),1),0),1),0)&LEFT(LEFT(MONTH(F4),1)+IF(LEN(MONTH(F4))>1,RIGHT(MONTH(F4),1),0),1)+IF(LEN(LEFT(MONTH(F4),1)+IF(LEN(MONTH(F4))>1,RIGHT(MONTH(F4),1),0))>1,RIGHT(LEFT(MONTH(F4),1)+IF(LEN(MONTH(F4))>1,RIGHT(MONTH(F4),1),0),1),0)&LEFT(LEFT(HOUR(G4),1)+IF(LEN(HOUR(G4))>1,RIGHT(HOUR(G4),1),0),1)+IF(LEN(LEFT(HOUR(G4),1)+IF(LEN(HOUR(G4))>1,RIGHT(HOUR(G4),1),0))>1,RIGHT(LEFT(HOUR(G4),1)+IF(LEN(HOUR(G4))>1,RIGHT(HOUR(G4),1),0),1),0)&LEFT(LEFT(MINUTE(G4),1)+IF(LEN(MINUTE(G4))>1,RIGHT(MINUTE(G4),1),0),1)+IF(LEN(LEFT(MINUTE(G4),1)+IF(LEN(MINUTE(G4))>1,RIGHT(MINUTE(G4),1),0))>1,RIGHT(LEFT(MINUTE(G4),1)+IF(LEN(MINUTE(G4))>1,RIGHT(MINUTE(G4),1),0),1),0)&"#"&COUNTIF($C$4:C4,C4)

    This is working exactly as planned.

    1 more question please if thats ok?
    COUNTIF($C$4:C4,C4)
    Is it possible please, if this part results in a single digit, the formula adds a 0 to the start resulting in 01, not 1
    But if in double digits, leaves the 0 out so 11 would not become 011?

    Thankyou so kindly for your assistance.

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Adding numbers in a cell

    Please try at E4


    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    07-01-2017
    Location
    UK
    MS-Off Ver
    365
    Posts
    80

    Re: Adding numbers in a cell

    Perfect.

    Thankyou SO! much.

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,955

    Re: Adding numbers in a cell

    Happy to help and thanks for the feedback

+ 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 Numbers To a Cell that Already Has Numbers
    By SPF29 in forum Excel General
    Replies: 8
    Last Post: 02-17-2016, 10:11 AM
  2. [SOLVED] Adding numbers in the same cell
    By JimLau in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-27-2012, 11:10 PM
  3. Adding up numbers that are in one cell
    By Shoubakka in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2011, 04:51 AM
  4. Adding numbers to cell references in formula, rather than cell values
    By stanja in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2009, 07:41 PM
  5. adding numbers in a single cell as a running total in that cell ?
    By jlg371 in forum Excel - New Users/Basics
    Replies: 9
    Last Post: 02-01-2009, 08:40 PM
  6. Replies: 4
    Last Post: 11-16-2008, 05:48 PM
  7. Adding numbers in one cell and showing total in seperate cell
    By Deernad Construction in forum Excel General
    Replies: 12
    Last Post: 11-29-2005, 03:35 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