+ Reply to Thread
Results 1 to 9 of 9

Complicated multi part IF formula

  1. #1
    Registered User
    Join Date
    11-24-2015
    Location
    Evergreen, CO
    MS-Off Ver
    2007
    Posts
    5

    Complicated multi part IF formula

    This is the written out version of what I need converted to Excel speak. Don't think it possible in one formula, so may be looking at a series of steps.

    If B2 > 0 enter "In stock" in C2. If B2 = 0 and A2 appears in column G, enter "Discontinued" in C2. If B2 = 0 and A2 appears in column H, enter "Preorder" in C2. If B2 = 0 and A2 does not appear in either columns G or H, enter "Out of stock" in C2.

    Can anyone help me make this happen?

    Thanks in advance for any assistance!
    Denise

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Complicated multi part IF formula

    Hi and welcome to the forum,

    One way

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

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Complicated multi part IF formula

    I took it as the value in A2 could appear anywhere in columns G or H so I came up with this

    Please Login or Register  to view this content.
    Hope it helps

  4. #4
    Registered User
    Join Date
    11-24-2015
    Location
    Evergreen, CO
    MS-Off Ver
    2007
    Posts
    5

    Re: Complicated multi part IF formula

    That is correct. A2 could appear anywhere in columns G or H.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Complicated multi part IF formula

    Other option:

    Please Login or Register  to view this content.
    Quang PT

  6. #6
    Registered User
    Join Date
    11-24-2015
    Location
    Evergreen, CO
    MS-Off Ver
    2007
    Posts
    5

    Re: Complicated multi part IF formula

    Hey Philb1 - Thanks for much for your help! I love learning new code.

    =IF(B2<>"","In Stock",

    IF(AND(B2="",ISERROR(INDEX($H:$H,MATCH($A$2,$H:$H,0))),ISERROR(INDEX($G:$G,MATCH($A$2,$G:$G,0)))),"Out Of Stock",

    IF(AND(B2="",NOT(ISERROR(INDEX($G:$G,MATCH($A$2,$G:$G,0))))),"Discontinued",

    IF(AND(B2="",NOT(ISERROR(INDEX($H:$H,MATCH($A$2,$H:$H,0))))),"Preorder"))))


    Ok, can you explain to me what this is doing? I understand the first line. If B2 is empty, write "In stock". This kinda doesn't work for me, because none of my cells are actually empty. I need it to see if the cell = 0 or greater than 0. But I might can work around that.

    The third and fourth lines seem to say if B2 is empty AND found in column such and such, enter the appropriate text. The NOT in this sentence throws me off, but I can go with it.

    I guess this is sort of a reverse function, in that NOT means it is found, and not using NOT means it isn't found? Because the second line seems to say, if B2 is empty AND NOT found in columns H and G, enter the appropriate text.

    Have I got that right?

    Only problem is, I have implemented this in my spreadsheet and it's only returning "In stock" and "Out of stock". Even if the other two options are what should be in the cell, that's not what's happening.

  7. #7
    Registered User
    Join Date
    11-24-2015
    Location
    Evergreen, CO
    MS-Off Ver
    2007
    Posts
    5

    Re: Complicated multi part IF formula

    Hi bebo021999! That's awesome. Thanks so much for your reply. Your formula is really elegant and helps with the zero problem. I implemented it in my spreadsheet and anywhere I have zeros, it's only returning the Discontinued response. I'm not getting any Out of stocks or Preorders. Any ideas?

    Thanks!
    Denise

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Complicated multi part IF formula

    Quote Originally Posted by drocus View Post
    Hi bebo021999! I implemented it in my spreadsheet and anywhere I have zeros, it's only returning the Discontinued response. I'm not getting any Out of stocks or Preorders. Any ideas?
    Note that A2 is nailed with absolute symbol $. If you want A2 is relative, just remove it, to be A2 only.

  9. #9
    Registered User
    Join Date
    11-24-2015
    Location
    Evergreen, CO
    MS-Off Ver
    2007
    Posts
    5

    Re: Complicated multi part IF formula

    Thanks bebo021999! That's was it! Works perfectly now.

+ 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. Need help with complicated IF formula
    By sparker08 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-19-2015, 03:44 PM
  2. Complicated multi workbook countifs help
    By IronCladRooster in forum Excel General
    Replies: 1
    Last Post: 01-07-2015, 05:55 PM
  3. Multi part if statement
    By scruz9 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-22-2014, 07:52 AM
  4. [SOLVED] Need a complicated formula to display part of current workbook name in a cell
    By ianpwilliams in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-06-2013, 01:41 PM
  5. Replies: 0
    Last Post: 03-29-2009, 10:55 PM
  6. Rather Complicated Formula
    By paulmaddock in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-08-2008, 09:36 AM
  7. Transferring part of a multi-dimensional array to a range in VBA
    By Bob J. in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2005, 11:05 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