+ Reply to Thread
Results 1 to 6 of 6

"If" formula not bringing up correct outcome

  1. #1
    Registered User
    Join Date
    11-06-2014
    Location
    Panama
    MS-Off Ver
    2010
    Posts
    5

    Question "If" formula not bringing up correct outcome

    I am grading some papers....
    I must admit I am a newbie...

    Column D is my data entry column -my students answers
    Column C has the correct answers

    For each question, I would like to be able to know whether it was answered right, wrong or left blank and tally the answers that way.

    Therefore, Cell D3 (answers) can be either
    1. the right answer and be equal to C3 ($D3="$C3") ----- I would like to have a 1 in this cell then
    2. an incorrect answer ($D3<>$C3,-----------------------I would like to have a 2 in this cell
    3. a blank answer ($D3=" " ------------------------------I would like to have a 3 in this cell

    I am having a bit of a problem putting together an IF formula that makes the distinction between #2 and #3...
    I am thinking that <> automatically includes #3 as well.


    I want the formula to put in the cell...
    1 if Correct answer
    2 if Incorrect answer
    3 if blank

    any ideas? I know this is super easy for you guys but I have been tweaking this formula to no end...
    =IF($D3=$C3,"1",IF($D3<>$C3,"2",IF(D3=" ","3")))



    thanks
    Last edited by joamer; 11-08-2014 at 10:56 AM. Reason: confusing wording

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: "If" formula not bringing up correct outcome

    The problem is that if it is blank, then it is also not equal to the answer, so your D3<>C3 check is always true. Just change the order to check for the blank first (and you can remove an IF statement).
    =IF($D3=$C3,"1",IF($D3=" ","3","2"))
    Some comments:
    1) is your blank a space (" ") or an empty cell ("")?
    2) why are you using text "1", "2", and "3" instead of the numbers 1, 2, and 3? Your choice, just be aware that if you want to do math, you should use numbers.
    3) not sure if you need the $ referencing or not. You intermittently used it for D3. Just make sure it is working as you wish.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: "If" formula not bringing up correct outcome

    =if(c2="",3,if(c2<>d2,2,1))
    Ben Van Johnson

  4. #4
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: "If" formula not bringing up correct outcome

    Hi, try

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


    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Click just below left if it helps, Boo?ath?

  5. #5
    Registered User
    Join Date
    11-06-2014
    Location
    Panama
    MS-Off Ver
    2010
    Posts
    5

    Re: "If" formula not bringing up correct outcome

    Worked great!! Thanks

  6. #6
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: "If" formula not bringing up correct outcome

    Hi, thanks for the feedback

+ 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. Why #VALLUE! error on "correct" formula in Excel 2007?
    By pollyannadanna in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-15-2013, 10:17 AM
  2. solution for the blank cell using the IF function
    By ragnaedge in forum Excel General
    Replies: 4
    Last Post: 08-23-2013, 11:03 AM
  3. [SOLVED] Equation for "Y", "N", or "?" Outcome
    By garrett.grillo in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 06-21-2013, 04:44 PM
  4. Please correct the lookup formula attach file ( Colum No "J")
    By Umer Hussain in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-04-2012, 04:14 AM
  5. Replies: 5
    Last Post: 10-12-2010, 06:46 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