+ Reply to Thread
Results 1 to 7 of 7

lookup question to automate spreadsheet

  1. #1
    Registered User
    Join Date
    03-16-2008
    Posts
    4

    lookup question to automate spreadsheet

    Dear All,

    I have here one excel file called ( Daily_PRICING .xls ), located on my C Harddrive.

    This File ( workbook ), contain 4 Worksheets , as following:-

    Sheet-1 - For Our First Product, which is PROD_1
    Sheet-2 - For Our Second Product, which is PROD_2
    Sheet-3 - For Our Third Product, which is PROD_3
    Sheet-4 - For Daily Report



    The First sheet which is called ( PROD_1 ) , have 6 colums, which are :-

    1- Date
    2-Low Price
    3-High Price
    4-Average Price
    5-Average Price Market
    6-Change.

    On every day morning, i used to enter the low price, high price and then i got automatic the others ( Average Price-Average Price Market-Change ).


    The One which i need your Help is in the Sheet No 4.

    Sheet No 4, we need to send it everyday, and it should have the following :-

    1- Product Name
    2-Date
    3-Current Price.

    I want only to enter the Product Name , and then automatically, it needs to read the Date Automatically, from the date which i enter it before, and then on the current price, it will take the Avergae for that day.

    I want to make it automatic.

    Can you please tell me how to do it, either manually, or using macro.

    waiting for your help.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    rolamohammed,

    Welcome to the forum.

    Please take a couple of minutes to read the forum rules below.

    See if the attached helps. I've assumed you wanted to return the last entry on each sheet

    =IF(ISNA(LOOKUP(9.99999999999999E+307,INDIRECT(A2&"!A:A"))),"Not found!!",LOOKUP(9.99999999999999E+307,INDIRECT(A2&"!A:A")))
    VBA Noob
    Attached Files Attached Files
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    03-16-2008
    Posts
    4

    Yes

    Yes, This is what i want

    can you please explain to me exactly , how you did, in order to understand .

    I prefear if we can communicate over the E-mail, because i want you to help me to do it.

    Idea, i need to understand it , can you please let explain to me.

    Waiting for your reply.
    Last edited by VBA Noob; 03-16-2008 at 09:27 AM.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    The main part of the formula is

    LOOKUP(9.99999999999999E+307,INDIRECT(A2& "!A:A"))),"
    Which uses the indirect function and a lookup

    The indirect function is used to determine which sheet to look up e.g If A2 says PROD_2 it looks at that sheet in Col A and then the Lookup finds the last cell in the col.

    See links for more

    http://www.xldynamic.com/source/xld.....html#last_any

    http://www.bettersolutions.com/excel...T131821001.htm

    VBA Noob

  5. #5
    Registered User
    Join Date
    03-16-2008
    Posts
    4

    Smile

    This is really what i want to know.

    But i want you to explain to me the structure of the formulla .

    Here is the formulla :-

    ==========================================================
    =IF(ISNA(LOOKUP(9.99999999999999E+307,INDIRECT(A2&"!E:E"))),"Not found!!",LOOKUP(9.99999999999999E+307,INDIRECT(A2&"!E:E")))

    ==========================================================

    Let us have a look to each fucntion :-

    The function which is called - ISNA- is for the following :-

    Its one of the IS Function, and its for (Value refers to the #N/A (value not available) error value ) .

    Or

    Returns TRUE if the value is the #N/A error value.

    Ok,

    Please explain to me the structure , becasue i want to implement it in my real enviroment.

    waiting for your reply.

    Rola,

    [email protected]

  6. #6
    Registered User
    Join Date
    03-16-2008
    Posts
    4

    Smile

    you said

    The indirect function is used to determine which sheet to look up.

    e.g If A2 says PROD_2 it looks at that sheet in Col A and then the Lookup finds the last cell in the col.

    and the formula as following :-

    =IF(ISNA(LOOKUP(9.99999999999999E+307,INDIRECT(A2&"!E:E"))),"Not found!!",LOOKUP(9.99999999999999E+307,INDIRECT(A2&"!E:E")))

    How can i determine for him / or how to instruct him to search for specific sheet ? for example, if the sheet name is ( NAPHTA ), how can i write it ?

    and how can i determine for him to look for a specifc column ?

    PLEASE EXPLAIN TO ME .

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Without indirect the formula would be

    =LOOKUP(9.99999999999999E+307,E:E)
    For the active sheet.

    if you want to add the sheet name to look up it would be
    =LOOKUP(9.99999999999999E+307,NAPHTA!E:E)
    If no value was found it returns #N/A so to avoid that you would use an if statement (See link)

    http://www.j-walk.com/ss/excel/usertips/tip010.htm

    The links I provided earlier will help with the rest

    VBA Noob

+ 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