PC Review


Reply
Thread Tools Rate Thread

Alt+Enter Formula/VBA help

 
 
=?Utf-8?B?TmV3QmlrZQ==?=
Guest
Posts: n/a
 
      9th Oct 2006
Hi all -
I have two spreadsheets that index data from one spreadsheet into another.
Works fine, no problem... HOWEVER now it has become necessary that the data
in the source file has multiple lines entered in the one cell (using
Alt+Enter)being indexed. This means my formula in the destination file needs
to "see" each line in the source cell, along with all cells in the column
being indexed.

Example:
forumla in other spreadsheet: =INDEX('[spreadsheet
A.xls]Sheet1'!$A:$B,MATCH(N18,'[spreadsheet A.xls]Sheet1'!$A:$A,0),2)

A B
1 957 20
2 254 30
256
321
3 500 19

If N18 in spreadsheet B equals 256, I should get a result of 30.

Any ideas how I can get this formula to work with the Alt+Enter??
 
Reply With Quote
 
 
 
 
Tom Ogilvy
Guest
Posts: n/a
 
      9th Oct 2006
Try:

=if(iserror(INDEX('[spreadsheet
A.xls]Sheet1'!$A:$B,MATCH("*"&N18&"*",'[spreadsheet
A.xls]Sheet1'!$A:$A,0),2)),INDEX('[spreadsheet
A.xls]Sheet1'!$A:$B,MATCH(N18,'[spreadsheet
A.xls]Sheet1'!$A:$A,0),2),INDEX('[spreadsheet
A.xls]Sheet1'!$A:$B,MATCH("*"&N18&"*",'[spreadsheet
A.xls]Sheet1'!$A:$A,0),2))

Although, since you looking up on the left column, you could try vlookup
instead.

--
Regards,
Tom Ogilvy




"NewBike" <(E-Mail Removed)> wrote in message
news:1BCD34E8-5A6E-4D09-9B0F-(E-Mail Removed)...
> Hi all -
> I have two spreadsheets that index data from one spreadsheet into another.
> Works fine, no problem... HOWEVER now it has become necessary that the
> data
> in the source file has multiple lines entered in the one cell (using
> Alt+Enter)being indexed. This means my formula in the destination file
> needs
> to "see" each line in the source cell, along with all cells in the column
> being indexed.
>
> Example:
> forumla in other spreadsheet: =INDEX('[spreadsheet
> A.xls]Sheet1'!$A:$B,MATCH(N18,'[spreadsheet A.xls]Sheet1'!$A:$A,0),2)
>
> A B
> 1 957 20
> 2 254 30
> 256
> 321
> 3 500 19
>
> If N18 in spreadsheet B equals 256, I should get a result of 30.
>
> Any ideas how I can get this formula to work with the Alt+Enter??



 
Reply With Quote
 
=?Utf-8?B?TmV3QmlrZQ==?=
Guest
Posts: n/a
 
      9th Oct 2006
Hi Tom -
Sorry for the two posts, the first one gave me an error that it did not
post...

I just tried the formula and it worked for cells with more than one line,
but now does not pick up cells with single lines.


"Tom Ogilvy" wrote:

> Try:
>
> =if(iserror(INDEX('[spreadsheet
> A.xls]Sheet1'!$A:$B,MATCH("*"&N18&"*",'[spreadsheet
> A.xls]Sheet1'!$A:$A,0),2)),INDEX('[spreadsheet
> A.xls]Sheet1'!$A:$B,MATCH(N18,'[spreadsheet
> A.xls]Sheet1'!$A:$A,0),2),INDEX('[spreadsheet
> A.xls]Sheet1'!$A:$B,MATCH("*"&N18&"*",'[spreadsheet
> A.xls]Sheet1'!$A:$A,0),2))
>
> Although, since you looking up on the left column, you could try vlookup
> instead.
>
> --
> Regards,
> Tom Ogilvy
>
>
>
>
> "NewBike" <(E-Mail Removed)> wrote in message
> news:1BCD34E8-5A6E-4D09-9B0F-(E-Mail Removed)...
> > Hi all -
> > I have two spreadsheets that index data from one spreadsheet into another.
> > Works fine, no problem... HOWEVER now it has become necessary that the
> > data
> > in the source file has multiple lines entered in the one cell (using
> > Alt+Enter)being indexed. This means my formula in the destination file
> > needs
> > to "see" each line in the source cell, along with all cells in the column
> > being indexed.
> >
> > Example:
> > forumla in other spreadsheet: =INDEX('[spreadsheet
> > A.xls]Sheet1'!$A:$B,MATCH(N18,'[spreadsheet A.xls]Sheet1'!$A:$A,0),2)
> >
> > A B
> > 1 957 20
> > 2 254 30
> > 256
> > 321
> > 3 500 19
> >
> > If N18 in spreadsheet B equals 256, I should get a result of 30.
> >
> > Any ideas how I can get this formula to work with the Alt+Enter??

>
>
>

 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      9th Oct 2006
If it worked before on the same data set, it should continue to work. Your
original formula is included in the formula I posted.

--
Regards,
Tom Ogilvy


"NewBike" <(E-Mail Removed)> wrote in message
news:5F5FE325-19BE-4E17-A816-(E-Mail Removed)...
> Hi Tom -
> Sorry for the two posts, the first one gave me an error that it did not
> post...
>
> I just tried the formula and it worked for cells with more than one line,
> but now does not pick up cells with single lines.
>
>
> "Tom Ogilvy" wrote:
>
>> Try:
>>
>> =if(iserror(INDEX('[spreadsheet
>> A.xls]Sheet1'!$A:$B,MATCH("*"&N18&"*",'[spreadsheet
>> A.xls]Sheet1'!$A:$A,0),2)),INDEX('[spreadsheet
>> A.xls]Sheet1'!$A:$B,MATCH(N18,'[spreadsheet
>> A.xls]Sheet1'!$A:$A,0),2),INDEX('[spreadsheet
>> A.xls]Sheet1'!$A:$B,MATCH("*"&N18&"*",'[spreadsheet
>> A.xls]Sheet1'!$A:$A,0),2))
>>
>> Although, since you looking up on the left column, you could try vlookup
>> instead.
>>
>> --
>> Regards,
>> Tom Ogilvy
>>
>>
>>
>>
>> "NewBike" <(E-Mail Removed)> wrote in message
>> news:1BCD34E8-5A6E-4D09-9B0F-(E-Mail Removed)...
>> > Hi all -
>> > I have two spreadsheets that index data from one spreadsheet into
>> > another.
>> > Works fine, no problem... HOWEVER now it has become necessary that the
>> > data
>> > in the source file has multiple lines entered in the one cell (using
>> > Alt+Enter)being indexed. This means my formula in the destination file
>> > needs
>> > to "see" each line in the source cell, along with all cells in the
>> > column
>> > being indexed.
>> >
>> > Example:
>> > forumla in other spreadsheet: =INDEX('[spreadsheet
>> > A.xls]Sheet1'!$A:$B,MATCH(N18,'[spreadsheet A.xls]Sheet1'!$A:$A,0),2)
>> >
>> > A B
>> > 1 957 20
>> > 2 254 30
>> > 256
>> > 321
>> > 3 500 19
>> >
>> > If N18 in spreadsheet B equals 256, I should get a result of 30.
>> >
>> > Any ideas how I can get this formula to work with the Alt+Enter??

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?UGFwYURvcw==?=
Guest
Posts: n/a
 
      9th Oct 2006
Not easy to do, because of possible substring matches.
Here is an ugly formula that should work:
=INDEX( '[spreadsheetA.xls]Sheet1'!$A$1:$B$10, SUMPRODUCT( ( ( '[spreadsheet
A.xls]Sheet1'!$A$1:$A$10 = N18 ) + ( ( COUNTIF( '[spreadsheet
A.xls]Sheet1'!$A$1:$A$10, N18 ) = 0 ) * ( ( LEFT( '[spreadsheet
A.xls]Sheet1'!$A$1:$A$10, LEN( N18 ) + 1 ) = N18 & CHAR( 10 ) ) + ( RIGHT(
'[spreadsheet A.xls]Sheet1'!$A$1:$A$10, LEN( N18 ) + 1 ) = CHAR( 10 ) & N18 )
+ ( LEN( '[spreadsheet A.xls]Sheet1'!$A$1:$A$10 ) - LEN( SUBSTITUTE(
'[spreadsheet A.xls]Sheet1'!$A$1:$A$10, CHAR( 10 ) & N18 & CHAR( 10 ), "" ) )
- 2 = LEN( N18 ) ) ) ) ) * ROW( INDIRECT( "$1:$" & ROWS( '[spreadsheet
A.xls]Sheet1'!$A$1:$A$10 ) ) ) ), 2 )

Adjust to your ranges (Don't use full rows !).
It has limitations, it doesn't check for errors and duplicates are adding
up...
--
Festina Lente


"NewBike" wrote:

> Hi all -
> I have two spreadsheets that index data from one spreadsheet into another.
> Works fine, no problem... HOWEVER now it has become necessary that the data
> in the source file has multiple lines entered in the one cell (using
> Alt+Enter)being indexed. This means my formula in the destination file needs
> to "see" each line in the source cell, along with all cells in the column
> being indexed.
>
> Example:
> forumla in other spreadsheet: =INDEX('[spreadsheet
> A.xls]Sheet1'!$A:$B,MATCH(N18,'[spreadsheet A.xls]Sheet1'!$A:$A,0),2)
>
> A B
> 1 957 20
> 2 254 30
> 256
> 321
> 3 500 19
>
> If N18 in spreadsheet B equals 256, I should get a result of 30.
>
> Any ideas how I can get this formula to work with the Alt+Enter??

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When I enter a formula it shows the formula not the result Dominic Microsoft Excel Misc 2 4th Aug 2008 12:08 PM
is it possible to enter in text over a formula without deleting the formula? Danie.Bright@gmail.com Microsoft Excel Misc 3 12th Nov 2007 10:32 PM
When I enter a formula, Excel shows the formula not the results =?Utf-8?B?UGF0IEFkYW1z?= Microsoft Excel Worksheet Functions 4 25th Jul 2007 09:56 PM
can you wrap formula results via a formula eg. Alt Enter =?Utf-8?B?QnJ5YW4gTWNIdWdo?= Microsoft Excel Misc 5 8th Mar 2007 12:52 AM
What does hitting Ctrl + Shift + Enter to enter a formula do??? Help a n00b out. qwopzxnm Microsoft Excel Worksheet Functions 2 20th Oct 2005 09:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:58 AM.