+ Reply to Thread
Results 1 to 4 of 4

Nested IF Using SEARCH functions

Hybrid View

SoleAris Nested IF Using SEARCH... 01-24-2012, 01:44 PM
NBVC Re: Nested IF Using SEARCH... 01-24-2012, 02:16 PM
SoleAris Re: Nested IF Using SEARCH... 01-24-2012, 02:25 PM
NBVC Re: Nested IF Using SEARCH... 01-24-2012, 03:24 PM
  1. #1
    Registered User
    Join Date
    04-07-2011
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    19

    Nested IF Using SEARCH functions

    Hey all,

    So I thought this one was an easy formula, however I can't seem to get the formula right.

    I have a PivotTable that displays the shipping information for each "carton" that we ship for a particular order. In that PivotTable, information such as the dimensions, the contents, etc. are displayed. However, I'd like to get the cartons to display in the PivotTable in a logical order (our big products cartons first, followed by smaller product cartons and then finally our miscellaneous parts cartons for the order). My solution to this was to create a field that assigns a value to each item depending on the description of that item. A "big product" would be assigned a value of "A", small products a value of "B", and parts "C".

    I figured I could just create multiple nested IF statements utilizing the SEARCH function (to look for a particular word in the item description field) to give me the values of {A, B, C} if it matched one of the words. However, I can only get the first IF statement to give me the results I want, and the rest of the values in my formula field return blanks. Here is an example of my code to get my "A" value:

    Table Range is A9:I58, with column E being my Item Description field

    =IFERROR(IF(SEARCH("*BIG*", 'Order Details'!$E9)=1, "A"), "")
    This returns me the value "A" for any description containing the word "BIG" in it. Now when I try to add onto this IF statement by nesting another IF in it, I simply get a blank. I am placing it in the if [false] part of the first IF statement, is that my error? Example:

    =IFERROR(IF(SEARCH("*BIG*", 'Order Details'!$E9)=1, "A", IF(SEARCH("*SMALL*", 'Order Details'!$E9)=1, "B")), "")
    Any help would be greatly appreciated..I feel like this is an easy fix and I'm just overlooking something here. Also, is this the easiest way to go about ordering my set of data displayed in my PivotTable? I plan to take this formula field and insert it (but hide it) into the PivotTable to use as the sort for my list of cartons.



    -------------------------------------------------------------------------

    Also, for bonus reps, any solutions to this?


    So my ODBC source imports the contents of each order based upon an entered order number. Let's say, however, that one "big product" imports with a quantity of 2, rather than 1. Since it's a big product, it will need to ship in 2 separate cartons, however it imports as 1 row of data. In the table, I've just been assigning the value of "1, 2" for the Carton# field to signify that this item will require cartons # 1 and 2. This works, however it's not as pretty or uniform with the rest of the cartons being individually listed. Is there a way to separate these two carton values into 2 rows of data eventually getting put into my PivotTable? If you need a visual example of this, please let me know.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Nested IF Using SEARCH functions

    Try:

    =IF(ISNUMBER(SEARCH("BIG", 'Order Details'!$E9)), "A", IF(ISNUMBER(SEARCH("SMALL", 'Order Details'!$E9)), "B",""))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    04-07-2011
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Nested IF Using SEARCH functions

    Quote Originally Posted by NBVC View Post
    Try:

    =IF(ISNUMBER(SEARCH("BIG", 'Order Details'!$E9)), "A", IF(ISNUMBER(SEARCH("SMALL", 'Order Details'!$E9)), "B",""))
    Works great. Thank you Very similar to my formula but I knew a quick fix was right there.



    Anyone for the 2nd question? Still stumped on that one myself.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Nested IF Using SEARCH functions

    Please start a new thread with that topic as it is not really related.

+ 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