Forecast

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Forecast

  1. #1
    New Member
    Join Date
    Feb 2013
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Forecast

     
    Hello,
    I used following two formulas but not working:
    I have one summary sheet with names and some of names has few spaces and other sheet is detail sheet which also have few spaces in front of names, result my vlookup function is not working. I used following but none worked
    =IF(ISNA(VLOOKUP(A3,FC!A:B,2,0)),"0",VLOOKUP(A3,FC!A:B,2,0))
    =VLOOKUP(A4,INDEX(TRIM(FC!A:B),0,0),2,0)

    Hitachi summary has one space in the front and Hitachi in FC has 3 spaces in the front of Hitachi.
    Cash summary
    WK1
    Apple 3.4
    EMC 2.5
    Hitachi 0


    FC
    Apple 3.4
    EMC 2.5
    Hitachi 4.5


    Thanks,
    Lakeshore



  2. #2
    MrExcel MVP
    Moderator
    xenou's Avatar
    Join Date
    Mar 2007
    Location
    Clev. OH, USA
    Posts
    15,554
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Forecast

      
    I think your second formula will work, but you must array enter it to evaluate the trim function for every cell. You array enter the formula by entering the formula as usual, then hitting Control+Shift+Enter all at once, instead of just Enter. Or in this case since the formula already exists, hit F2, then Control+Shift+Enter. Lets use index instead of VLookup though:
    =INDEX(FC!B:B,Match(A4,TRIM(FC!A:A),0))
    (array entered with control+shift+enter)

    I'd prefer to use a dynamic named range to avoid using an entire column in the formula (though I don't really know if it matters or not). If the performance is poor or Excel balks at using an entire column in this formula, try a dynamic named range as explained here:
    Excel Function Friday: INDEX for Dynamic Range | Contextures Blog
    The basics of named ranges are explained here:
    Excel Names -- Excel Named Ranges

    With your defined names in place, then instead:
    =INDEX(_Company,Match(A4,TRIM(_Amount),0))
    (array entered with control+shift+enter - assume the defined names are _Company and _Amount for the company names and the weekly totals.
    Last edited by xenou; Feb 24th, 2013 at 04:22 PM.

    Using: Office 2010/Win7 (work) Office 2010/Win7 (home)

    You are rich in proportion to the number of things you can let alone.
    -- Henry David Thoreau

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com