Announcement

Collapse
No announcement yet.

If cells in a column contain chosen text then print other text in adjacent cell.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • If cells in a column contain chosen text then print other text in adjacent cell.

    I have a spread sheet that is about 8000 rows. I need code to check if cells in Column D contain certain text (in this case: $50) and if so print this text: ___ $100 into the adjacent cell in Column E.

    D E
    $40
    $30
    $10
    $50 ___$100
    $10
    $50 ___$100

  • #2
    Re: If cells in a column contain chosen text then print other text in adjacent cell.

    Put this formula into E2 and fill down

    =IF(D2="$50","___ $100","")

    Then use copy and paste values

    Comment


    • #3
      Re: If cells in a column contain chosen text then print other text in adjacent cell.

      Bare with me, I'm a newbie at this.

      That does work, but if I paste the formula down I would have that formula in cells that are not true. Is there a way to setup up layers so that if the statement is false(column B is something other than $50) it would paste another value down? Essentially, I have other values that should be pasted based on the first column.

      I have a feeling that a macro is needed for this.

      $50 ____ $100
      $2
      $70
      $70
      $23
      Please help.

      Thanks in advance.

      Comment


      • #4
        Re: If cells in a column contain chosen text then print other text in adjacent cell.

        I have other values that should be pasted based on the first column
        Why not provide *ALL* of the details from the start? You'll get a more accurate answer sooner.

        To get the most precise answers, it is best to upload a sample workbook (sensitive data scrubbed/removed) that shows a few manually created examples of the desired results.
        The structure and data types of the workbook must exactly match that of the real workbook. Include in the workbook a clear and explicit explanation of all requirements.The sample workbook only needs to contain enough data to illustrate the need to aid with developing the solution.

        How to edit your post or thread title or upload an attachment

        1. Click the EDIT POST in the gray band immediately below your post
        2. Click Go Advanced
        3. Edit the post or thread title
        4. To upload: scroll down to Manage Attachments -- use ZIP compression if necessary to meet file size limitations
        -----------------------------------------------------

        Maybe you can adapt this:
        =LOOKUP(D2,{10,50,70},{"___If it's ten","____$100","___if it's 70"})

        Replace the "___if it's . . ." with whatever you need. Adjust the number values in the array {10,50,70} as required.
        AAE
        ----------------------------------------------------

        Forum Rules | Message to Cross Posters | How to use Tags

        Comment

        Working...
        X