+ Reply to Thread
Results 1 to 7 of 7

If statement return value

  1. #1
    Registered User
    Join Date
    01-17-2012
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    40

    If statement return value

    Hi there,

    What I am trying to do is return a value for a field that is the highest.
    I think what I am looking for is an IF statement but I am open to other suggestions.

    I am not the best at describing so I included a sample.
    If_sample.xls

    Cell C14 grabs the max number of the numbers above ranging A2:E10, now I need it to grab the time to the left in which case would be 0700-0800 and than in cell B13 grab the persons name in which case would be TIM.

    Thanks for your time and help.
    Last edited by devilchild99; 10-18-2013 at 11:04 PM.

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: If statement return value

    =INDIRECT(ADDRESS(1;SMALL(IF(A2:E10=C14;COLUMN(A:E)-1;"");1)))
    Try this array formula (<CTRL><SHFT><ENTER>)
    It goes wrong with duplicate values eg 25)
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    Registered User
    Join Date
    01-17-2012
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: If statement return value

    Hmm, I took the formula and pasted (with Ctrl, Shift, Enter) but I can get errorr that says The formula you typed contains an error.

  4. #4
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: If statement return value

    Change semicolon in colon
    In the Netherlands we use the ; to separate the parameters
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-17-2012
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: If statement return value

    ahh yes, thanks that worked perfectly, how would I make it show the time in field below?...i am trying to understand the code but I dont fully... so in that case 0700-0800 should be shown...how what do I change in the code to make it show that?

  6. #6
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: If statement return value

    Something like this?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-17-2012
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: If statement return value

    exactly...thank you very much...here have some reputation =)

+ 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] IF statement to return 0 if 0 in cell if not return formula
    By CraigieL in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 07-15-2013, 09:46 AM
  2. [SOLVED] Can a If statement to return value >0?
    By jgomez in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-04-2013, 02:46 PM
  3. return statement in function
    By denroi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-27-2010, 05:28 AM
  4. if statement - if A1 is blank then A2 to return zero
    By garyk007 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-10-2007, 10:37 PM
  5. Vlookup of an if statement return
    By James in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-06-2005, 07:06 PM

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