+ Reply to Thread
Results 1 to 11 of 11

IF(OR) Statement not giving results

  1. #1
    Registered User
    Join Date
    07-03-2016
    Location
    Singapore
    MS-Off Ver
    MS 2013
    Posts
    28

    IF(OR) Statement not giving results

    Hi guys, i am new to this thread, hopefully can get some help from here.

    i have an excel file that contains 2000 records.

    so lets say year 1- 2 they have a score of 1, and year 3-4 score of 2 and year 5-6 score of 3, year 7-8 score of 4 and lastly, year 9-11 score of 5

    N2 is year 11, M2 is year 10 and L2 is year 9.

    in my excel spreadsheet. D2 is year 1, E2 is year 2. F2 is year 3, G2 is year 4, H2 is year 5, I2 is year 6, J2 is year 7, K2 is year 8.

    so using this excel code; =IF(OR(N2>=5,M2>=5,L2>=5),5,0) --> Using this code i got a score of 5, but when i continue to input any value codes it gives me an error #value. The thing is not every record will get a score of 5. some will get 4 points and some will get 3 points.

    So, how do i continue the codes using (IF(OR)??
    Last edited by LaoDa; 07-03-2016 at 03:31 AM.

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: IF(OR) Statement not giving results

    =IF(OR(L2:N2>=5),5,) as CSE. for beginning. the rest is in your file

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: IF(OR) Statement not giving results

    There is nothing in the original formula that would result in a #VALUE error. If you're seeing that error then it is being caused by something in a precedent cell (one of the cells that the formula is looking at).

    If you have a formula in N2 like =A2+B2 then that would cause the error if either A2 or B2 contain anything other than a number. A formula that returns a blank is the most common cause because many users incorrectly think that it is the same as an empty cell.

  4. #4
    Registered User
    Join Date
    07-03-2016
    Location
    Singapore
    MS-Off Ver
    MS 2013
    Posts
    28

    Re: IF(OR) Statement not giving results

    Hi, i tried your way and this way. Still cant work.
    =IF(OR(L2:N2>=5),5,0)

    Any more help in this?
    Thanks

  5. #5
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    943

    Re: IF(OR) Statement not giving results

    Hi LaoDa,

    Did you input tim201110's suggestion as an array formula rather than a regular formula, i.e. enter it using the combination ctrl + shift + enter?

    Regards,

    Snook

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: IF(OR) Statement not giving results

    Quote Originally Posted by The_Snook View Post
    Did you input tim201110's suggestion as an array formula rather than a regular formula
    Even entered correctly, it will give the same error result as the original formula.

    Quote Originally Posted by LaoDa View Post
    Any more help in this?
    See post #3

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

    Re: IF(OR) Statement not giving results

    Quote Originally Posted by LaoDa View Post
    Hi, i tried your way and this way. Still cant work.
    You need to post a workbook so we don't keep guessing at what we are working with:

    (How to) Upload a Workbook directly to the Forum
    (please do not post pictures or links to worksheets)
    • Click Advanced next to Quick Post button at the bottom right of the editor box.
    • Scroll down until you see "Manage Attachments",
    • Click the "Choose" button at the upper left (upload from your computer).
    • Select your file, click "open", click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Close the Attachment Manager window.
    • Click "Submit Reply"
    Note: Please do not attach password protected workbooks/worksheets
    Ensure to disable any Workbook Open/Autorun macros before attaching!
    Ben Van Johnson

  8. #8
    Registered User
    Join Date
    07-03-2016
    Location
    Singapore
    MS-Off Ver
    MS 2013
    Posts
    28

    Re: IF(OR) Statement not giving results

    Hi guys i have uploaded the file.
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: IF(OR) Statement not giving results

    Still makes no sense, what did you change to make your original formula show a #value error?

    See if this works

    =IFERROR(LOOKUP(2,1/B2:L2,{1,1,2,2,3,3,4,4,5,5,5}),0)

  10. #10
    Registered User
    Join Date
    07-03-2016
    Location
    Singapore
    MS-Off Ver
    MS 2013
    Posts
    28

    Re: IF(OR) Statement not giving results

    Thanks for the help. It works.

  11. #11
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: IF(OR) Statement not giving results

    M2=IF(COUNTIF(J2:L2,">=5"),5,0)
    try this if it is not you are looking for give expected result
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

+ 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. Replies: 8
    Last Post: 06-07-2016, 11:28 AM
  2. vlookup giving #N/A results
    By Jazzzbo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-18-2014, 12:28 AM
  3. [SOLVED] Correct Formula not giving results
    By NJ007 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-25-2014, 09:06 PM
  4. [SOLVED] Vlookup giving Wrong Results
    By timbo1957 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-15-2013, 08:18 AM
  5. VLOOKUP not giving apt results....
    By lifeisaspreadsheet in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-04-2012, 04:36 AM
  6. "IF" statement not giving expected results
    By khank in forum Excel General
    Replies: 6
    Last Post: 11-17-2010, 04:14 PM
  7. Autofilter giving unexpected results!
    By Colin Vicary in forum Excel General
    Replies: 3
    Last Post: 09-28-2006, 07:20 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