+ Reply to Thread
Results 1 to 3 of 3

Comaring 2 columns and only reporting differences and discarding empty

  1. #1
    Registered User
    Join Date
    02-11-2013
    Location
    Karlstad / Sweden
    MS-Off Ver
    Excel 2003
    Posts
    23

    Comaring 2 columns and only reporting differences and discarding empty

    I'm trying to compare cells in a table against a query and create a report of those instances that needs attention.
    I've got it working where cells are different and the same, except I can't get it to mark occasions when both are empty as "good". Output looks like:

    Nick ICB ICBx ICB
    Tarfu773 Br Bl Check
    Nimrah Si Si Good
    Clan40 Good
    Lancehead Bl Good

    As you see I get a false positive in the case where the first column is empty.
    The formula I use is:

    ICB Check: IIf([ICB]="" And [ICBx]="";"Good";IIf([ICB]<>[ICBx];"Check";"Good"))

    I keep changing it around and trying variants but keep getting false neg/pos results no matter what I do
    ICB is a cell in a table and ICBx the corresponding cell created by a calculation in a query.

    In addition I would like the resulting query only shows rows where there's a discrepancy (basically print me a "to do" list over things to update).

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Comaring 2 columns and only reporting differences and discarding empty

    You need to add the NZ function to your IIF statement. If Access encounters a null value in a record (BTW there are no cells in access--that is an excel term), it does not know how to handle it. You need to direct it and NZ helps you do that.

    Look here on a tutorial for NZ.

    http://www.techonthenet.com/access/f...dvanced/nz.php
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    02-11-2013
    Location
    Karlstad / Sweden
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Comaring 2 columns and only reporting differences and discarding empty

    Thank you, will play with that. Seems it works if the query generated data is "empty" though, but fails if the table data is "empty" is there a technical difference between these two empty fields?

    edit:
    The NZ function solved it for me, thank you very much!
    Now to figure out how to return only those rows that needs checking.
    Last edited by SteinerKD; 02-26-2013 at 12:05 AM.

+ 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