+ Reply to Thread
Results 1 to 4 of 4

Nested IF with the output displaying text along with text from another cell

Hybrid View

  1. #1
    Registered User
    Join Date
    01-23-2013
    Location
    Tennessee, US
    MS-Off Ver
    Excel 2010
    Posts
    6

    Nested IF with the output displaying text along with text from another cell

    I have several columns with items and quantities. I am trying to compare one set to another and then display a checklist with a statement of the difference and instructions on what to do. Here is what I have so far.

    =IF(AND(B13=G13,D13=I13),"2.1 No CPU change needed.",IF(AND(B13<G13,D13=I13),"2.1 Add a CPU "&C13".",IF(AND(B13>G13,D13=I13),"2.1 Remove the 2nd "&C13" CPU.",IF(AND(B13<G13,D13<>I13),"2.1 Remove the "&C13" CPU and add a CPU "&H13".",IF(AND(B13>G13,D13<>I13),"2.1 Change out the CPU and remove a CPU.",IF(AND(B13=G13,D13<>I13),"2.1 Change out the CPU(s).",""))))))

    B13 contains the quantity of CPU's in the original machine, G13 contains the quantity of CPU's in the new machine. D13 contains the part number of CPU's in the original machine, I13 contains the part number of CPU's in the new machine. C13 is the description of the CPU from the original machine and H13 is the description of the CPU from the new machine.

    What I would like it to do is check if the quantity on both are the same and the part numbers are the same and then display "2.1 No CPU change needed."

    If the original machine has 1 CPU and the new machine has 2 CPUs but they are the same part number I want it to display "2.1 Add a 2nd description pulled from H13 CPU."

    If the original machine has 2 CPUs and the new machine has 1 CPU but they are the same part number I want it to display "2.1 Remove the 2nd description pulled from C13 CPU."

    If the original machine has 1 CPU and the new machine has 1 CPU but they are NOT the same part number I want it to display "2.1 Remove the description pulled from C13 CPU and install a description pulled from H13 CPU."

    If the original machine has 1 CPU and the new machine has 2 CPU's but they are NOT the same part number I want it to display "2.1 Remove the description pulled from C13 CPU and install quantity pulled from G13 description pulled from H13 CPUs."

    I think I am really close on the formula, but I can not seem to display the statement using the text from the other cells.

  2. #2
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: Nested IF with the output displaying text along with text from another cell

    Hi madhatr,

    What is the current problem with the formula? I think it would help if you posted an example spreadsheet as the formula you have already seems to make sense to me.
    Did I help? Click *- add to my rep.

  3. #3
    Registered User
    Join Date
    01-23-2013
    Location
    Tennessee, US
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Nested IF with the output displaying text along with text from another cell

    The problem is it is not pulling the data from the cell, it is giving a error. In a part like this:

    IF(AND(B13<G13,D13=I13),"2.1 Add a CPU "&C13"."

    It is not allowing &C13 to pull the text due to it being a IF formula I believe, or my syntax is incorrect. I assumed that it would display what was inside the quotes, followed by the text from &C13 and then pick up with the rest of the text inside the quotes.

  4. #4
    Registered User
    Join Date
    01-23-2013
    Location
    Tennessee, US
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Nested IF with the output displaying text along with text from another cell

    I figured it out, I was leaving out a &. It should have been IF(AND(B13<G13,D13=I13),"2.1 Add a CPU "&C13&"."

+ 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