+ Reply to Thread
Results 1 to 5 of 5

Using if then else in Excel 2007

  1. #1
    Registered User
    Join Date
    06-16-2011
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    40

    Smile Using if then else in Excel 2007

    Hello,
    I need help in writing a formula for on of the worksheets. It is kinda similar to my previous post -> http://www.excelforum.com/excel-prog...ml#post2546788

    For K3:

    IF(A3=A2) then (K3= (K2-J3)/100) Else (K3=(100-J3)/100)

    Similarly,

    For K4:
    IF(A4=A3) then (K4= (K3-J4)/100) Else (K4=(100-J4)/100)

    For K5:

    IF(A5=A4) then (K5= (K4-J5)/100) Else (K5=(100-J5)/100)

    and so on...

    Could you please provide the correct syntax to use this logic?
    Last edited by daymaker; 06-20-2011 at 02:58 AM. Reason: Solved

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Using if then else in Excel 2007

    Hi daymaker, my testing of the following code is on data that is meaningless so I cannot say for certain that it will do what your requirements imply but give it a try and let me know if it works:
    Please Login or Register  to view this content.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Using if then else in Excel 2007

    Sorry, it's sporting an error in the calculations, try:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Using if then else in Excel 2007

    Actually, I think this might do it?
    Place this in the cell at K3 and then drag down
    =IF(A3=A2,((K2-J3)/100),((100 - J3)/100))

    EDIT: The code from my previous 2 posts does not work correctly so please disregard it.
    Last edited by Mordred; 06-20-2011 at 02:41 AM.

  5. #5
    Registered User
    Join Date
    06-16-2011
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: Using if then else in Excel 2007

    Thanks a lot Mordred. This works perfectly.

    Regards,
    Daymaker

+ 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