+ Reply to Thread
Results 1 to 12 of 12

IF statement doesn't work as expected

  1. #1
    Registered User
    Join Date
    06-19-2015
    Location
    Rome, Italy
    MS-Off Ver
    Office 2013
    Posts
    5

    Unhappy IF statement doesn't work as expected

    Hello everybody,

    I have a problem with this statement =MAX(IF(($C$8:$C$13=$D2);$D$8:$D$13)) that return the VALUE! error.

    My need is to search for the MAX value only of some Rows (rows that has Owner="Mary" and not Owner="Tony" or "Jack").

    Any idea ?

    Thanks,
    ilao

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: IF statement doesn't work as expected

    It's an array formula, use Ctrl-Shift-Enter
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Contributor
    Join Date
    07-07-2014
    Location
    ericbartha.com
    MS-Off Ver
    2016 Professional
    Posts
    126

    Re: IF statement doesn't work as expected

    Hey ilao,

    Could you type a small sample of your data? It is hard to help without seeing it exactly.

  4. #4
    Registered User
    Join Date
    06-05-2015
    Location
    Manchester, UK
    MS-Off Ver
    2016
    Posts
    94

    Re: IF statement doesn't work as expected

    This is an array formula, so when you have finished editing you need to press Ctrl-Shift-Enter to make it work.

  5. #5
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,370

    Re: IF statement doesn't work as expected

    Are you ENTER the formula correctly? That's array formula, can not ENTER alone, you need press/hit all together CTRL+SHIFT+ENTER button...

  6. #6
    Forum Contributor
    Join Date
    07-07-2014
    Location
    ericbartha.com
    MS-Off Ver
    2016 Professional
    Posts
    126

    Re: IF statement doesn't work as expected

    I agree that it is an Array, but his formula might not solve identifying the correct owner.

  7. #7
    Registered User
    Join Date
    06-19-2015
    Location
    Rome, Italy
    MS-Off Ver
    Office 2013
    Posts
    5

    Re: IF statement doesn't work as expected

    A sample (not with Owner but with numbers) is the following. My Expected result is "7", that is the MAX of value with "3" as TAG. Additionally this information: the Function (Fx) Popup Windows correctly shows me "7" as final result, but in the cell the VALUE! error is displayed...



    #VALUE! 3


    3 3,00
    2 4,00
    3 5,00
    4 6,00
    3 7,00
    4 8,00

  8. #8
    Registered User
    Join Date
    06-19-2015
    Location
    Rome, Italy
    MS-Off Ver
    Office 2013
    Posts
    5

    Re: IF statement doesn't work as expected


  9. #9
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: IF statement doesn't work as expected

    Use

    =MAX(IF(C8:C13=D2,D8:D13))

    Array formula, use Ctrl-Shift-Enter

  10. #10
    Registered User
    Join Date
    06-19-2015
    Location
    Rome, Italy
    MS-Off Ver
    Office 2013
    Posts
    5

    Re: IF statement doesn't work as expected

    This is an array formula but the result should be a single scalar value that the pop up Fx window, show me correctly. But finally in the cell an error is displayed....

  11. #11
    Registered User
    Join Date
    06-19-2015
    Location
    Rome, Italy
    MS-Off Ver
    Office 2013
    Posts
    5

    Re: IF statement doesn't work as expected

    OK THANKS NOW WORKS. WAS Ctrl-Shift-Enter. I type Ctrl-Shift-Enter in the cell but the right place was in Formula BAR.

    Thank you everybody.

    Ciao

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: IF statement doesn't work as expected

    It should work in either location. Just use F2 then CTRL SHIFT ENTER
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. [SOLVED] Copying filtered table doesn't work as it is expected in Excel 2010
    By abbassi in forum Excel General
    Replies: 2
    Last Post: 06-29-2014, 01:57 AM
  2. Class use doesn't work as expected
    By seattle911 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-21-2014, 12:22 PM
  3. Formula doesn't work as expected????
    By muish in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-23-2013, 04:30 AM
  4. [SOLVED] combobox dynamic range doesn't work as expected
    By florin_excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-21-2012, 09:28 AM
  5. Why doesn't this IF statement Work
    By maurices5000 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-27-2008, 01:38 PM

Tags for this Thread

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