+ Reply to Thread
Results 1 to 3 of 3

if statement where cell is not empty

  1. #1
    Registered User
    Join Date
    10-01-2006
    Posts
    15

    if statement where cell is not empty

    when writing if statements, if I want a certain action when the cell is empty
    i write - if(A1="","do this","do something else"). But if I want it to do
    something when there is anything in the cell in question how do I write the
    statement? ie, if(A1="anything","do this","do something else".

    Hope I am making sense.

    Matt

  2. #2
    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
    Try

    f(A1=<>,"do this","do something else")

    VBA Noob

  3. #3
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by guerilla
    when writing if statements, if I want a certain action when the cell is empty
    i write - if(A1="","do this","do something else"). But if I want it to do
    something when there is anything in the cell in question how do I write the
    statement? ie, if(A1="anything","do this","do something else".

    Hope I am making sense.

    Matt
    another option is

    =IF(ISBLANK(A1),"do something else"," do this")

+ 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