+ Reply to Thread
Results 1 to 8 of 8

IF condition after the IF before is true ?

  1. #1
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    IF condition after the IF before is true ?

    The formula is in cell A4.

    IF cell A1 value is found in range "Stock"
    THEN put cell A2 with cell A1 value

    IF (cell A2 with cell A1 value) is resulting/causing cell A3 a blank value
    THEN have "Not Available" in cell A4.
    ELSE
    have "Available" in cell A4
    END IF

    ELSE
    have "Not Available" in cell A4.
    END IF

    So far, I try like this :
    Please Login or Register  to view this content.
    which of course it doesn't work .
    For me, it turns out making a formula is much much much more difficult then writing a VBA .

    So, how do I write the formula ?

    Any kind of help would be greatly appreciated.
    Thank you in advanced.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: IF condition after the IF before is true ?

    is Stock a range (table name) or is Stock the value in cell A1? And you have stock spelled differently in your cell Stock vs Stok.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: IF condition after the IF before is true ?

    is this what you are wanting?...
    =IF(AND(COUNTIF(B2:B10,A1)>0,A2=A1),"Not Available",IF(A3="","Not Available","Available"))
    you can also add another item to the AND to make it this way and I think this would also work...
    =IF(AND(COUNTIF(B2:B10,A1)>0,A2=A1,A3=""),"Not Available","Available")

    I substituted B2 through B10 for what I am assuming is your named range of stock.
    Last edited by Sam Capricci; 08-27-2019 at 04:55 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: IF condition after the IF before is true ?

    Quote Originally Posted by Sambo kid View Post
    is Stock a range (table name) or is Stock the value in cell A1? And you have stock spelled differently in your cell Stock vs Stok.
    Hi Sambo kid,
    The "Stock" is a named range.
    I'm sorry as I mixed-up the word with my own language, that's why the formula in the block code read "Stok".

    Thank you.

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: IF condition after the IF before is true ?

    So, did either of those formulas solve your issue (when you substitute Stock for B2:B10)?

  6. #6
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: IF condition after the IF before is true ?

    Quote Originally Posted by Sambo kid View Post
    is this what you are wanting?...
    =IF(AND(COUNTIF(B2:B10,A1)>0,A2=A1),"Not Available",IF(A3="","Not Available","Available"))
    you can also add another item to the AND to make it this way and I think this would also work...
    =IF(AND(COUNTIF(B2:B10,A1)>0,A2=A1,A3=""),"Not Available","Available")

    I substituted B2 through B10 for what I am assuming is your named range of stock.
    Hi Sambo kid,
    Thank you for the formula. But I'm sorry it still doesn't work.

    The problem maybe is in my computer as even a simple condition like this :
    Cell A1 contains a word "Squid".
    Cell A2 is blank.

    Cell A3, formula :
    =IF(A1="Squid",A2=A1)
    It doesn't fill cell A2 with a word "Squid".

    I give up, as I will just use the VBA.
    Anyway thank you for your help, Sambo.
    Last edited by karmapala; 08-28-2019 at 08:18 AM.

  7. #7
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: IF condition after the IF before is true ?

    well, if A1=squid, in that formula =IF(A1="Squid",A2=A1) it will return false.
    if you want Squid in A2 if it is in A1 you'd want this in A2, =IF(A1="squid",A1,"")
    A formula in A3 won't fill a value into A2. Yes, VBA would do that.

  8. #8
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: IF condition after the IF before is true ?

    Hi Sambo,
    Thank you for your explanation. I just realize about that after you inform me.

+ 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. [SOLVED] how to get first value, when condition true.
    By nnish in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-07-2017, 10:32 AM
  2. Help popup window if condition is TRUE in change event if conditon is true
    By fanku in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-09-2014, 12:46 PM
  3. [SOLVED] Copy all row if condition is true
    By norlax in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-13-2014, 12:01 PM
  4. Replies: 3
    Last Post: 02-02-2014, 04:26 AM
  5. [SOLVED] How to sum cel if condition is true
    By CarlosVA in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-28-2013, 04:24 PM
  6. open a comment to cell range upon true condition then removing comment on false condition
    By ferrum_equitis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2012, 12:55 AM
  7. TRUE condition???
    By pmguerra in forum Excel General
    Replies: 2
    Last Post: 06-05-2006, 11:35 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