+ Reply to Thread
Results 1 to 15 of 15

Excel 2007 : #VALUE problem

  1. #1
    Registered User
    Join Date
    12-20-2010
    Location
    Wales
    MS-Off Ver
    Excel 2007
    Posts
    40

    #VALUE problem

    Can somebody tell me why I'm getting #VALUE returned with the following formula when I15 and J15 are empty. It comes up when I try the I15+J15=10. I tried using it in the OR statement, I tried putting in an AND statement but no matter what I do the error keeps coming up when the two cells are empty.

    IF(I15+J15=10,"",IF(OR(I15="",J15=""),"",10-(I15+J15)))

    Below was the formula before but I now have to look for the value of 10 where I15+J15=10

    IF(OR(I15="",J15=""),"",10-(I15+J15))

    Thanks in advance.....
    Last edited by Rob44; 01-26-2011 at 08:21 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: #VALUE problem

    How about:

    =IF(OR(I15="", J15=""), "", IF(I15+J15=10, "", 10-(I15+J15)))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,433

    Re: #VALUE problem

    Try:

    IF(SUM(I15,J15)=10,"",IF(OR(I15="",J15=""),"",10-(SUM(I15,J15))))

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: #VALUE problem

    Or

    =IF(OR(I15="",J15="",I15+J15=10),"",10-(I15+J15))

  5. #5
    Registered User
    Join Date
    12-20-2010
    Location
    Wales
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: #VALUE problem

    Thanks fellas,
    I used Jerrys, as it was the first response, and it worked (I'm sure I tried it that way around before, maybe I did something wrong).

    Why did this #VALUE come up in the first place and why didn't my formula work....? (it worked but the error code came up)

    Cutter...just saw you response.....I had tried that but still got #VALUE
    Last edited by Rob44; 01-26-2011 at 08:17 PM.

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: #VALUE problem

    What were the values in I15 and J15 when you got the error?

    I don't get an error using your original formula with 20 & 15 in those cells.
    Last edited by Cutter; 01-26-2011 at 08:20 PM.

  7. #7
    Registered User
    Join Date
    12-20-2010
    Location
    Wales
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: #VALUE problem

    Hi Cutter,

    I15 and J15 were blank......

    I was wondering if the formula in I15 was in any way to blame even though it had returned nothing in the cell.

  8. #8
    Registered User
    Join Date
    12-20-2010
    Location
    Wales
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: #VALUE problem

    Formula works fine except where the two cells are blank

  9. #9
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: #VALUE problem

    Yes, the "" that your I15 and/or J15 held was the cause.

    Using the I15+J15 in your first test would be to blame, you can't add "" + ""

    You can SUM("":"") though

  10. #10
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: #VALUE problem

    Better go with this one:

    =IF(OR(SUM(I15,J15)=10,I15="",J15=""),"",10-(SUM(I15,J15)))

  11. #11
    Registered User
    Join Date
    12-20-2010
    Location
    Wales
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: #VALUE problem

    Cutter,
    Thanks for taking the time to explain......I'll try to remember that.

    Thanks TMShucks your answer shows what Cutter is saying.....

    Ah well back to work now.

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: #VALUE problem

    Nah, mine aborts the formula earlier if I15 or J15 is blank (staying with your original approach), the last suggestion one does more needless calcs because OR() evaluates all options before moving on.

  13. #13
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: #VALUE problem

    JB
    With that point in mind maybe this should be used:

    =IF(I15="", "",IF(J15="","",IF(I15+J15=10,"",10-(I15+J15))))

    It might save one extra calc.

  14. #14
    Registered User
    Join Date
    12-20-2010
    Location
    Wales
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: #VALUE problem

    Thanks Jerry,
    I can see why you say that, I have already copied down your formula with no problems.
    Thanks everyone for your input.

  15. #15
    Registered User
    Join Date
    12-20-2010
    Location
    Wales
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: #VALUE problem

    Cutter,
    Now why didn't I think of doing that in the first place

+ 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