+ Reply to Thread
Results 1 to 5 of 5

More than 7 IF statements

  1. #1
    Registered User
    Join Date
    01-19-2008
    MS-Off Ver
    Excel for M365 MSO
    Posts
    44

    More than 7 IF statements

    Hello Again,

    My second question is that I know you can use a VLookup function to bypass the limitation on the 7 If statements but here is what I am trying to do:
    • If K1 = A and M1=1 then I want to perform a calculation in another cell let's just say J1: Roundup((N7/2),0)
    • If K1 = A and M1=2 then J1=Roundup((N7/2)*2,0)
    • If K1 = B and M1=1 then J1= a different calculation

    I have about 8-10 if statements that need to do a special calculation. Now I tried creating a seperate sheet and place the individual calculations in there but it doesn't seem to work. Can anyone help me out?

  2. #2
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    523
    You can combine if statements by using the addition symbol.

    The following (nonsensical) example in which the value of a number in cell A1 is evaluated shows the idea:

    Please Login or Register  to view this content.
    You'll see that there are 8 IF statements in this piece of code but the last of them is included by using the + symbol.

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Link may be of interest

    http://www.excelforum.com/showpost.p...18&postcount=5

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  5. #5
    Registered User
    Join Date
    01-19-2008
    MS-Off Ver
    Excel for M365 MSO
    Posts
    44

    Thanks!

    I think these sites will help me in what I need to do...

    Thank you all for your help!

+ 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