Excel User Group
Microsoft Excel blogs, forums, files. Read, ask questions, provide answers.

IF Functions

Latest post Tue, Oct 6 2009 7:54 AM by Dan Shadbolt. 3 replies.
  • Thu, Oct 1 2009 7:07 AM

    • Dan Shadbolt
    • Top 200 Contributor
    • Joined on Sun, Oct 12 2008
    • London, UK
    • Posts 4
    • Points 68

    IF Functions

    Hi - can someone tell me how to set up an 'IF' statement so that if one letter or word is typed in a given cell one calculation is carried out and if another letter / word is typed into that cell another calculation is carried out?

    • Post Points: 37
  • Thu, Oct 1 2009 7:21 AM In reply to

    • Nick Hodge
    • Top 10 Contributor
    • Joined on Sun, Dec 23 2007
    • Southampton
    • Posts 543
    • Points 9,287
    • MVP

    Dan

    It depends how many IF's you have but basically you can nest up to seven in versions before 2007 after that is a much large number but if I use much more than two or three I tend to look to set up a table and use a VLOOKUP.

    The theory is..

    =IF(A1="This Word",B1+C1,D1+E1)

    In this case if the cell A1 contains This Word it will add B1 and C1 together and if not it will add D1 and E1 together. If you want to use multiple If's start the next IF where D1+E1 is and set a condition and True/False calculation to make.

    Regards
    Nick Hodge
    Microsoft MVP, Excel
    Southampton, UK

    Filed under:
    • Post Points: 21
  • Thu, Oct 1 2009 7:19 PM In reply to

    Hi Dan,

    An alternative is to use the Choose function, this allows you to choose an option, which could be a formula depending on an index number

    =Choose(A5, A1+B1, A1/B1, A1*B1) - so if you had 1 in A5, it will perform the first calculation, if you have 2 in A5, the second etc.

    Hope this helps

     

    • Post Points: 5
  • Tue, Oct 6 2009 7:54 AM In reply to

    • Dan Shadbolt
    • Top 200 Contributor
    • Joined on Sun, Oct 12 2008
    • London, UK
    • Posts 4
    • Points 68

    Many thanks Nick - your advice worked a treat!

    Regards,

    Dan

    • Post Points: 5
Page 1 of 1 (4 items) | RSS
Copyright Excel User Group and the relevant contributors, 2010. All Trade Marks acknowledged. This site is a peer-to-peer site and NOT affiliated in any way to Microsoft Corp. All rights reserved.