+ Reply to Thread
Results 1 to 5 of 5

Macro or Excel IF statement

  1. #1
    Registered User
    Join Date
    12-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Macro or Excel IF statement

    I need a little help on whether this should be done with a Macro or an IF statement.

    On the first tab, there is a field that the user inputs, and then i need to go to the second tab and if the field is in between the range of the column C and D, then i need to return Column A and E back to the first tab. But if it is not in the range, it needs to go down to the next line, and the next line until the range is met. Any ideas? I need a little help.

    THANKS!

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Need help with Macro or Excel IF statement

    To help us understand and provide a precise answer, post a sample workbook that exactly duplicates the structure of your real workbook and contains a bit of representative data (non-sensitive). Manually show what the desired results should be.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    12-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Need help with Macro or Excel IF statement

    Here is an example.
    Attached Files Attached Files

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Macro or Excel IF statement

    Perhaps this is what you intended (though I added text in the formula).

    =VLOOKUP($B$4,Data!$A$5:$E$12,1,TRUE) &" Minutes Ran, "& VLOOKUP($B$4,Data!$A$5:$E$12,4)&" Calories Burned"

    Returns this result: 100 Minutes Ran, 120 Calories Burned

  5. #5
    Registered User
    Join Date
    12-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Macro or Excel IF statement

    Thanks for the help, however there is a loop hole. What if the variable that the user inputs is not in the range on the "data" tab? Nothing happends, can you put something in there that if it is over A5 and under A6, use A6?

+ 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