Forecast

Thanks:  0
Likes:  0

1. ## 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. ## 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.

## User Tag List

#### Posting Permissions

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