+ Reply to Thread
Results 1 to 8 of 8

How to use IF to pull in values from another column

Hybrid View

  1. #1
    Registered User
    Join Date
    05-14-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    32

    How to use IF to pull in values from another column

    Hello, I have the case below and need help with writing an IF statement:

    Colume A:
    N
    Y
    _ (blank)
    N

    Colume B:
    Pre
    Post
    Post
    Pre

    I want an IF to do the following: If Col B="Pre", use blank and if Col A="Post" use value in Col A.
    How would you write this?

    Thank you so much for your help!!

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: How to use IF to pull in values from another column

    Quote Originally Posted by rcocalm View Post
    I want an IF to do the following: If Col B="Pre", use blank and if Col A="Post" use value in Col A.
    I think what you meant to say was
    I want an IF to do the following: If Col B="Pre", use blank and if Col B="Post" use value in Col A
    Try
    =IF(B2="Pre","",IF(B2="Post",A2,""))

    Or if Pre and Post are the only 2 possible options for column B, then just
    =IF(B2="Pre","","Post")

  3. #3
    Registered User
    Join Date
    05-14-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: How to use IF to pull in values from another column

    Yes, your rewrite of my question is correct: I want an IF to do the following: If Col B="Pre", use blank and if Col B="Post" use value in Col A.
    I tried your 1st statement it doesn't pull in the values in Col A for the "Post" in Col B. Your second statment doesn't really work.

    Does anyone else have an idea?

    Thank you!!!

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: How to use IF to pull in values from another column

    Sorry the 2nd one should have been
    =IF(B2="Pre","",A2)

    But the first one definately works as described..
    Attached Files Attached Files
    Last edited by Jonmo1; 10-01-2013 at 09:33 AM.

  5. #5
    Registered User
    Join Date
    05-14-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: How to use IF to pull in values from another column

    The statement is returning 0 when clearly i want to change it to "" (blank) when the value in Col A for Pre is blank. Why is that? So instead of getting "" as the return, I am getting 0s.
    How do you fix this?

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: How to use IF to pull in values from another column

    Can you post your book?

    I would guess that your cells in column B don't = Pre or Post EXACTLY...
    check them for extra spaces
    "Pre " vs " Pre" vs "Pre"

  7. #7
    Registered User
    Join Date
    05-14-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: How to use IF to pull in values from another column

    here is my data set. There are blank values in col A for both Pre and Post. the IF is working for the Pre, but still returns 0 for the Post when the value is blank...
    WIll you please check? Thanks alot!
    Sorry i couldn't figure out where to upload the excel so this is an image...test.jpg
    There is no extra space in Col B.

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: How to use IF to pull in values from another column

    Try
    =T(IF(B2="Pre","",A2))

+ 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. Match to columns in different sheets and pull the 3rd column values
    By Pats83 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-03-2013, 11:45 AM
  2. Replies: 4
    Last Post: 05-19-2013, 07:12 PM
  3. [SOLVED] How to pull values from a column, and list them in a cell
    By Naja in forum Excel General
    Replies: 11
    Last Post: 11-05-2012, 04:38 PM
  4. Pull unique values based on adjacent column
    By freud1 in forum Excel General
    Replies: 9
    Last Post: 07-02-2012, 11:36 AM
  5. Function that will pull the unique values out of a column?
    By Rgaherty in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-13-2007, 09:06 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