+ Reply to Thread
Results 1 to 5 of 5

Excel returns wrong value?

  1. #1
    Registered User
    Join Date
    04-16-2017
    Location
    Aarhus, Denmark
    MS-Off Ver
    2010
    Posts
    74

    Excel returns wrong value?

    =IF(K3=1;12;IF(K3=2;10;IF(K3=3;8;IF(K3=4;7;IF(K3=5;6;IF(K3=6;5;IF(K3=7;4;IF(K3=8;3;IF(K3=9;2;IF(K3=10;1)+IF(O3=1;12;IF(O3=2;10;IF(O3=3;8;IF(O3=4;7;IF(O3=5;6;IF(O3=6;5;IF(O3=7;4;IF(O3=8;3;IF(O3=9;2;IF(O3=10;1)))))))))))))))))))

    In K3 the value is 1, and in O3 it's also 1. But then formula return 12, why not 24?
    Last edited by thomexcel; 05-20-2017 at 09:41 AM.

  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: Excel returns wrong value?

    You've nested the O part inside the K section, so it only triggers when K=9.

    1) create you K an O formulas separately in different cells. Make sure they are working independently. THEN merge them into a single formula with a + in between.
    _________________
    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 Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Excel returns wrong value?

    Another approach, switch to a lookup table:

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    P
    Q
    R
    S
    1
    Lookup
    Return
    2
    1
    12
    3
    2
    10
    1
    1
    12
    =VLOOKUP(K3, $A$2:$B$11, 2, 0)
    4
    3
    8
    12
    =VLOOKUP(O3, $A$2:$B$11, 2, 0)
    5
    4
    7
    24
    =VLOOKUP(K3,$A$2:$B$11,2,0)+VLOOKUP(O3,$A$2:$B$11,2,0)
    6
    5
    6
    7
    6
    5
    8
    7
    4
    9
    8
    3
    10
    9
    2
    11
    10
    1
    12
    13


    This is easy to edit, and you can put this lookup table on a separate sheet, of course.

  4. #4
    Registered User
    Join Date
    04-16-2017
    Location
    Aarhus, Denmark
    MS-Off Ver
    2010
    Posts
    74

    Re: What is wrong with formula?

    Thanks I figured it out

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

    Re: Excel returns wrong value?

    See post #4.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. what is the wrong of formula
    By hktom in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-06-2015, 05:44 PM
  2. What's wrong with this formula
    By ukdodger in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-27-2015, 06:57 AM
  3. What's wrong with my MAX(IF) formula?
    By Jed Shields in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-25-2012, 04:40 AM
  4. Something wrong with my formula?
    By Lene in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 08-26-2009, 05:53 AM
  5. something Wrong with my formula...Help
    By Raf0006 in forum Excel General
    Replies: 6
    Last Post: 08-13-2007, 09:15 AM
  6. [SOLVED] Can anyone tell me what's wrong with this formula?
    By Linda in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-12-2006, 05:43 PM
  7. What is wrong with this formula?
    By grinlrar in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-01-2005, 06:05 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