+ Reply to Thread
Results 1 to 7 of 7

Is it possible to write an IF statement containing multiple references to 2 other cells?

  1. #1
    Registered User
    Join Date
    11-01-2011
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Is it possible to write an IF statement containing multiple references to 2 other cells?

    Hi,

    I would like to know if it is possible to write an IF statement that addresses all of the following conditions in one cell:-

    If Cell A1 and C1 are both blank, Cell E3 is blank
    If Cell A1 contains any numeric value and C1 is blank, Cell E3 is blank
    If Cell C1 contains any numeric value and A1 is blank, Cell E3 is blank
    If Cell A1 and C1 both contain zero, Cell E3 contains the text "Zero"
    If Cell A1 contains any numeric value greater than the value in Cell C1, Cell E3 contains the text "A"
    If Cell C1 contains any numeric value greater than the value in Cell A1, Cell E3 contains the text "B"
    If Cell A1 contains the same numeric value as C1 (but greater than zero), Cell E3 contains the text "C"

    I understand it is possible to do something like this:-

    =IF(A1>C1,"A","")&IF(C1<A1,"B","") etc...

    But I'm not sure how to address all of the conditions I listed.

    Hope someone can help. Many thanks.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,466

    Re: Is it possible to write an IF statement containing multiple references to 2 other cell

    Try this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.




    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,466

    Re: Is it possible to write an IF statement containing multiple references to 2 other cell

    See the attached sample workbook:

    Regards, TMS
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-01-2011
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Is it possible to write an IF statement containing multiple references to 2 other cell

    Absolutely brilliant - thanks a million.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,466

    Re: Is it possible to write an IF statement containing multiple references to 2 other cell

    You're welcome.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  6. #6
    Registered User
    Join Date
    11-01-2011
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Is it possible to write an IF statement containing multiple references to 2 other cell

    Duly done, thanks again.

  7. #7
    Registered User
    Join Date
    07-02-2013
    Location
    karnataka
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Is it possible to write an IF statement containing multiple references to 2 other cell

    Hi, note the file enclosed with the conditions you specified

    Regards
    Gomathi
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to create Read/Write VBA Userform that references variable cells/rows in a sheet?
    By Sivart9876 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-16-2012, 10:58 AM
  2. How to write multiple IF statement
    By culverhr in forum Excel General
    Replies: 5
    Last Post: 05-14-2012, 05:47 PM
  3. Replies: 11
    Last Post: 08-22-2011, 12:40 PM
  4. Write text to multiple cells using variants
    By therealjag in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-18-2009, 10:56 AM
  5. Write Listbox selection to Multiple cells
    By eklarsen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-24-2005, 04:07 AM

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