+ Reply to Thread
Results 1 to 8 of 8

Nested if and Left and right statements

  1. #1
    Registered User
    Join Date
    01-05-2012
    Location
    Neverland
    MS-Off Ver
    2007
    Posts
    9

    Nested if and Left and right statements

    hi guys new to this forum,

    trying to write an excel nested if

    here is the situation i have mm/year in A1.. 1/2011

    from a1 to a4 i want to write out if A1 left "1" then make a1= 2, if its 2 then make a2 = 3

    thats for changing month then i need another iffor the year.. the value of a1 left is 4 then a2 will change to 01/2012 and a3 will 3/2012

    i was starting out with simple left but with 2 nested if's i get an error..
    =IF(LEFT(A1)="1",LEFT(A1 +1),A1,IF(LEFT(A1)="2",LEFT(A1+1),A1))

    you entered too many arguments for this function..

    any ideas..
    Last edited by NBVC; 01-13-2012 at 09:25 AM.

  2. #2
    Registered User
    Join Date
    09-26-2010
    Location
    A, A
    MS-Off Ver
    Excel 2003
    Posts
    86

    Re: Nested if and Left and right statements

    =DATE(YEAR(A1),MONTH(A1)+1,DAY(A1))... try this function and keep copying the formula to right

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Nested if and Left and right statements

    is the date in A1 a date formatted as mm/yyyy or is it a text entry?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    01-05-2012
    Location
    Neverland
    MS-Off Ver
    2007
    Posts
    9

    Re: Nested if and Left and right statements

    Date is text entry its actually coming from a WEBi report on portal , coming in Xcelsius, but i have used Excel on top of it. the first formula wont work as the date in the first field can change from 1 to 4. the dates are dynamic and they can change any time a new report is generated thats why i need an if to see what the first number is.

    i could change the format to MM/YYYY.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Nested if and Left and right statements

    On your formula, you just need to remove the A1 in the middle, eg.

    =IF(LEFT(A1)="1",LEFT(A1 +1),IF(LEFT(A1)="2",LEFT(A1+1),A1))

    or shorten to..

    =IF(OR(LEFT(A1)={"1","2"}),LEFT(A1+1),A1)

  6. #6
    Registered User
    Join Date
    01-05-2012
    Location
    Neverland
    MS-Off Ver
    2007
    Posts
    9

    Re: Nested if and Left and right statements

    sorry guys that only worked for the first 2, i tried to use the comma and add the formuals for the 3rd and 4th fiedl and it errors out again. also how can i write it out for the right brace for the year. as when it shows 4/2011 then the next number will becomes 1/2012

  7. #7
    Registered User
    Join Date
    01-05-2012
    Location
    Neverland
    MS-Off Ver
    2007
    Posts
    9

    Re: Nested if and Left and right statements

    this is what i used

    =IF(LEFT(A1)="1",LEFT(A1 +1),IF(LEFT(A1)="2",LEFT(A1+1),A1),IF(LEFT(A1)="3",LEFT(A1+1),A1),IF(LEFT(A1)="4",LEFT(A1+1),A1))))

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Nested if and Left and right statements

    Try:

    =A1+IF(LEFT(A1)+0<=4,1,0)

+ 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