+ Reply to Thread
Results 1 to 14 of 14

formula getting first two numbers in another cell

  1. #1
    Registered User
    Join Date
    09-05-2010
    Location
    italy
    MS-Off Ver
    Excel 2018
    Posts
    63

    formula getting first two numbers in another cell

    Hi all,

    I need help in finding the right formula getting only the first two numbers of a date.
    Example1:
    Cell a1
    01-Jan-10

    Cell a2
    01

    Example2
    Cell a1
    23-Mar-10

    Cell a2
    23

    I need a formula in cell a2 that only gets first two numbers of another cell.

    thank you,

    Carlo
    Last edited by kghisla; 11-14-2010 at 05:53 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,596

    Re: formula getting first two numbers in another cell

    If your data are dates try =DAY(A1)

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: formula getting first two numbers in another cell

    If you need the leading zero you probably have to format the formula cell as "Custom" setting format
    to DD
    Last edited by Alf; 11-14-2010 at 02:20 PM. Reason: Seems I can't spell

  4. #4
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: formula getting first two numbers in another cell

    TEXT(A1,"dd") with a date in A1 06/01/2010 this will display the correct result 06 but if you try turning it back into a number you will lose the leading zero if thats what you need
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

  5. #5
    Registered User
    Join Date
    09-05-2010
    Location
    italy
    MS-Off Ver
    Excel 2018
    Posts
    63

    Re: formula getting first two numbers in another cell

    Hi,

    I am sorry I could not explain myself.
    Hereby I am attaching a dummy file that hopefully explain better what I need.
    Regards,

    Carlo
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: formula getting first two numbers in another cell

    Is what you're looking for an the cells between B8 and B91 to be a 1 also or are you looking for it to increment as the days count, for example B9 B10 B11 should they be 2 3 4 or do you want them all to be 1?

  7. #7
    Registered User
    Join Date
    09-05-2010
    Location
    italy
    MS-Off Ver
    Excel 2018
    Posts
    63

    Re: formula getting first two numbers in another cell

    Hi Scott,

    thank you very much for your help.
    I think with your help I am getting closer.

    what I need is 1 because the loan had been issued the first of July.
    therefore, if the loan was issued on July 23rd, the formula should be day(a8)=23

    in reply to your clarification, it should be like this; B9 B10 B11 = 1
    1 in case loan was issued 1 of july
    23 if it was issued july 23rd.

    Hope I could explain this time.

    thank you again.

  8. #8
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: formula getting first two numbers in another cell

    I would also put this formula in your first monthly payment date EOMONTH(B4,0)+1 but you may need ro install the analysis tool pack if your using 2003 then it will automatically calculate as soon as you put a date
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-05-2010
    Location
    italy
    MS-Off Ver
    Excel 2018
    Posts
    63

    Re: formula getting first two numbers in another cell

    I have Excel for Mac 2008
    Version 12.2.7

    I attached the file as it supposed to look like.

    I need to change this part in the formula: DAY(A8)=1
    Instead of 1 there should be day of the month Loan started.

    thank you.

    Carlo
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: formula getting first two numbers in another cell

    IFERROR(IF($A8<($B$4+($D$4*30)),"",IF(AND(SUM($B$7:B7)<CEILING($E$4*$C$4,1),$A$8<>"",DAY(A8)=DAY($B$4)),$E$4,"")),"")

    replace your 1 with the day function entered as above

  11. #11
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: formula getting first two numbers in another cell

    i've altered the date formula for you as well, even if you have a loan taken out in december the function will mark the correct payment day and date in january
    Attached Files Attached Files

  12. #12
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: formula getting first two numbers in another cell

    In hindsight forget the formula to generate the dates automatically, you'd run into problems if someon took out a loan on 31/08/2010 or same date in january

  13. #13
    Registered User
    Join Date
    09-05-2010
    Location
    italy
    MS-Off Ver
    Excel 2018
    Posts
    63

    Re: formula getting first two numbers in another cell

    Scott,

    It worked perfect, thank you very much!!

    kind regards,

    Carlo G

  14. #14
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: formula getting first two numbers in another cell

    Carlo, i'm glad we got there in the end. But, the issue i mentioned will cause you problems if someone takes a loan on the last day in any month that has 31 days and the following month has less. In that scenario it will miss the month that doesnt have 31 as the last day and every month in your range that doesnt go all the way to 31 I'm not familiar with the differences between Excel for mac 2008 and Excel for Windows 2007, but in the above scenario perhaps an if statement combined with the end of month function to state that if the day of your loan date = 31 or the month of your loan date = 2 then use end of month, otherwise the formula your already using.

    If loans cant be taken out that late in the month then theres no issue

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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