+ Reply to Thread
Results 1 to 4 of 4

IF Statement to return variable outcomes

  1. #1
    Registered User
    Join Date
    06-24-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    IF Statement to return variable outcomes

    I would like some help if possible with an IF statement I am trying to develop.

    What I am trying to do is search a range of cells (G4:G21) for a value, in this case 1000. When I find that value I wish to return a corresponding name & number to the second sheet of my workbook. So for example if 1000 is found in G10 then I would like to return the name in B10, & the number in F10 to the second sheet of my workbook. I assume I have to somehow modify the value_if_true part of the equation but I don't know how to.

    This is the formula I am using, which lets me return a specific name (Sheet2!B4) but this is not always right.

    =IF(COUNTIF(Sheet2!G4:G21,1000),Sheet2!B4,"")

    Any help would be greatly appreciated. I have also attached the spreadsheet itself.

    Aaron Sharpe Spreadsheet.xlsx

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: IF Statement to return variable outcomes

    hi Brebs69, welcome to the forum. in sheet2!B4, try:
    =INDEX(Sheet2!$F$4:$F$21,MATCH(TEXT(REPLACE($A4,LEN($A4)-1,0," "),"hhmm")+0,Sheet2!$G$4:$G$21,0))

    for C5, simply change the red portion:
    =INDEX(Sheet2!$B$4:$B$21,MATCH(TEXT(REPLACE($A4,LEN($A4)-1,0," "),"hhmm")+0,Sheet2!$G$4:$G$21,0))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: IF Statement to return variable outcomes

    issue is your front sheet and back sheet time formats dont match
    attached amendment

    b4 put
    Please Login or Register  to view this content.
    C4
    Please Login or Register  to view this content.
    Attached Files Attached Files
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Registered User
    Join Date
    06-24-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: IF Statement to return variable outcomes

    Thanks for that, that's what I was trying to do.

+ 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