Closed Thread
Results 1 to 8 of 8

What's wrong with this IF statement?

  1. #1
    Forum Contributor
    Join Date
    10-29-2004
    Posts
    291

    What's wrong with this IF statement?

    I'm using to cross reference two sheets. One contains all my customers email addresses, the other contains a list of email address that were not supposed to email.

    Please Login or Register  to view this content.
    Last edited by djarcadian; 12-14-2013 at 02:38 PM. Reason: Realized I had the wrong sheet reference but I'm still getting an error.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: What's wrong with this IF statement?

    Whats it doing that it's not supposed to be? What version of excel are you using? maybe you could simplify this a bit with iferror()?

    =IF(iferror(VLOOKUP(A3,DoNotEmaii!$A$1:$AA$1000000,16,FALSE),iferror(VLOOKUP(A3,AccountList!$A$1:$AA$1000000,16,FALSE),""))

    (untested)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    10-29-2004
    Posts
    291

    Re: What's wrong with this IF statement?

    I'm just getting a general error. I was doing this in Google Sheets but also tested it in Excel 2007 and got the same general error. "The formula you types has an error"

    I tested your code too and it didn't work.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: What's wrong with this IF statement?

    OK its hard to work blind Can you post a sample and show what you expect please?

  5. #5
    Forum Contributor
    Join Date
    10-29-2004
    Posts
    291

    Re: What's wrong with this IF statement?

    https://docs.google.com/spreadsheets...it?usp=sharing

    I've made this public so you should be able to access it. On the "Front" sheet find the code in E3. You can see the more basic lookup in D3.

  6. #6
    Forum Contributor
    Join Date
    10-29-2004
    Posts
    291

    Re: What's wrong with this IF statement?

    To expand on what I wrote.

    The AccountsLlist is a list of all our customer accounts with names and email addresses.

    The DoNotEmail sheet contains a list of Accounts that do not wish to receive emails from us.

    The Front sheet column E should contain a list which compares the AccountsLIst and DoNotEmail list and will only shows the filtered list (people who want emails).

    If you check the D3 cell on the Front sheet you'll see that the Vlookup works to find a particular accounts email address. You can modify that by switching it to show the DoNotEmail sheet.

    I tried to use the IF statement to compare the two so it only shows emails for Accounts that want to receive email addresses.

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: What's wrong with this IF statement?

    This will check both worksheets for a match and if not found will return a blank cell.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This will lookup the value in A3 and if found on the DoNotEmail list will return the value in column 16 otherwise it will return a blank cell

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This will lookup the value in A3 and if found on the AccountList will return the value in column 16 otherwise it will return a blank cell

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    OR

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,784

    Re: What's wrong with this IF statement?

    Close at request of OP, new thread was started in Commercial Services.

    http://www.excelforum.com/commercial...-sure-why.html

    Thread Closed.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. wrong:IF statement
    By scubadiver007 in forum Excel General
    Replies: 2
    Last Post: 03-28-2011, 11:47 AM
  2. If Statement, or am I going about this wrong?
    By JJAndradeIII in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-11-2008, 06:49 AM
  3. What is wrong with this If statement?
    By shaolin in forum Excel General
    Replies: 3
    Last Post: 01-30-2008, 01:11 PM
  4. [SOLVED] wts wrong with this statement
    By Jason in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-24-2006, 10:30 AM
  5. [SOLVED] What is wrong with this IF statement? need help.
    By AC man in forum Excel General
    Replies: 4
    Last Post: 01-11-2006, 11:35 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