Results 1 to 4 of 4

Need IF Then Statement

Threaded View

  1. #2
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Need IF Then Statement

    Not sure I follow exactly what you need, however here is how multiple IF's work

    Nesting if statements works like this:
    { } are not part of the formula and there as describers of the line
    =IF(test_statements,
    {then}do this,
    {else}IF(test2_statements,
    {then}do this,
    {else}IF(test3_statements,
    {then}do this,
    {else},do this)
    So for example, the following logic:
    If A1 > 10 then B2, but if A1 < 10 then C2, if neither then return D2
    would be

    =IF(A1>10,B2,IF(A1<10,C2,D2)
    Note: If your test statement comes back TRUE it will use the first argument, FALSE will use the second. Either argument can be another IF statement with it's own test, and result arguments.


    So
    =IF(1=1, "Result A","Result B") will return "Result A", but
    =IF(1=2, "Result A","Result B") will return "Result B".
    Last edited by Speshul; 07-08-2014 at 02:25 PM.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  2. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  3. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  4. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  5. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 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