+ Reply to Thread
Results 1 to 5 of 5

IF Statement

  1. #1
    Registered User
    Join Date
    04-10-2015
    Location
    Cleveland, OH
    MS-Off Ver
    Office 365
    Posts
    24

    IF Statement

    Hello.

    I am trying to use an IF statement, and I am not sure how to proceed further. What I need the formula to do is this: If cell B2 is blank, then return blank, if not the retrieve the name associated with the content of cell b2. I have written this part. I need to add: if B2 is STILL blank after the first search, then look for the associated name in another place. I have attached a small sample of my workbook.

    IF THIS DO THIS IF STILL THIS DO THIS.xlsm

    Any help will be greatly appreciated!

    Emma

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: IF Statement

    this looks like it works....

    put this in cell D2 and copy it down

    Please Login or Register  to view this content.
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    12-11-2014
    Location
    Dallas, TX
    MS-Off Ver
    2010
    Posts
    94

    Re: IF Statement

    I hope I've understood this correctly, but here is how I would handle it:

    =IF(
    B2="",
    "",
    IFERROR(
    INDEX('First List'!$A$2:$B$10,MATCH(B2,'First List'!$B$2:$B$10,0),1),
    INDEX('Second List'!$A$2:$C$10,MATCH(B2,'Second List'!$C$2:$C$10,0),1)
    )
    )

    Here it is without line breaks:

    =IF(B2="","",IFERROR(INDEX('First List'!$A$2:$B$10,MATCH(B2,'First List'!$B$2:$B$10,0),1),INDEX('Second List'!$A$2:$C$10,MATCH(B2,'Second List'!$C$2:$C$10,0),1)))

    Edit: Rats, beat to the punch.
    Last edited by npatridge; 04-29-2015 at 06:02 PM.
    If I have helped you, please add to my reputation!

  4. #4
    Registered User
    Join Date
    04-10-2015
    Location
    Cleveland, OH
    MS-Off Ver
    Office 365
    Posts
    24

    Re: IF Statement

    Thank you so much! It works perfectly!

  5. #5
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: IF Statement

    awesome, glad we could help and thanks for the rep points and setting the thread to Solved...have a great day

+ 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. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  2. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  3. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  4. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  5. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM

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