ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ? Function to copy based on choice (https://www.excelbanter.com/excel-programming/444481-function-copy-based-choice.html)

webels

? Function to copy based on choice
 
Hi
I think a function would be able to achieve this but I am unsure where
to start

Say my data is in
Col A ColB
12
13 X
15

Someone chooses either 12, 13 or 15 by placing an "X" in B1,B2(in the
above case),or B3.
Whever the X is placed I woul like to copy the value to cell C2.

Is this possible.

Thanks
Eddie


Donald Guillett

? Function to copy based on choice
 
On Apr 20, 4:40*pm, webels wrote:
Hi
I think a function would be able to achieve this but I am unsure where
to start

Say my data is in
Col A * * ColB
12
13 * * * * * * X
15

Someone chooses either 12, 13 or 15 by placing an "X" in B1,B2(in the
above case),or B3.
Whever the X is placed I woul like to copy the value to cell C2.

Is this possible.

Thanks
Eddie


Have a look in the help index for MATCH and then incorporate into
INDEX

webels

? Function to copy based on choice
 
On Apr 21, 12:13*am, Donald Guillett wrote:
On Apr 20, 4:40*pm, webels wrote:









Hi
I think a function would be able to achieve this but I am unsure where
to start


Say my data is in
Col A * * ColB
12
13 * * * * * * X
15


Someone chooses either 12, 13 or 15 by placing an "X" in B1,B2(in the
above case),or B3.
Whever the X is placed I woul like to copy the value to cell C2.


Is this possible.


Thanks
Eddie


Have a look in the help index for MATCH and then incorporate into
INDEX


Thanks Don -

I used the following and it works perfect.


=INDEX($A$1:$A$3,MATCH(C5,$B$1:$b$3,0))

Putting the value “x” in C5 and the formula in d5 I can place an x in
B1 or B2 or B3 and match the value.
I’m guessing there is no way to allow any character be placed in B1 or
B2 or B3 other than x and still return the values (allowing for users
who fail to use “x” as instructed)?
All the best
Eddie

Larry[_20_]

? Function to copy based on choice
 
On Apr 22, 4:55*pm, webels wrote:
On Apr 21, 12:13*am, Donald Guillett wrote:









On Apr 20, 4:40*pm, webels wrote:


Hi
I think a function would be able to achieve this but I am unsure where
to start


Say my data is in
Col A * * ColB
12
13 * * * * * * X
15


Someone chooses either 12, 13 or 15 by placing an "X" in B1,B2(in the
above case),or B3.
Whever the X is placed I woul like to copy the value to cell C2.


Is this possible.


Thanks
Eddie


Have a look in the help index for MATCH and then incorporate into
INDEX


Thanks Don -

I used the following and it works perfect.

=INDEX($A$1:$A$3,MATCH(C5,$B$1:$b$3,0))

Putting the value “x” in C5 and the formula in d5 I can place an x in
B1 or B2 or B3 and match the value.
I’m guessing there is no way to allow any character be placed in B1 or
B2 or B3 other than x and still return the values (allowing for users
who fail to use “x” as instructed)?
All the best
Eddie


Try using data validation on Column B, restricting the input to an
"X". If any other text is input, an error message appears. That error
message can be customized to explain that an "X" is needed.

Claus Busch

? Function to copy based on choice
 
Hi Eddie,

Am Fri, 22 Apr 2011 13:55:59 -0700 (PDT) schrieb webels:

I?m guessing there is no way to allow any character be placed in B1 or
B2 or B3 other than x and still return the values (allowing for users
who fail to use ?x? as instructed)?


for any character:
=INDEX($A$1:$A$3,MATCH("*",$B$1:$B$3,0))


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

webels

? Function to copy based on choice
 
On Apr 24, 2:05*pm, Claus Busch wrote:
Hi Eddie,

Am Fri, 22 Apr 2011 13:55:59 -0700 (PDT) schrieb webels:

I?m guessing there is no way to allow any character be placed in B1 or
B2 or B3 other than x and still return the values (allowing for users
who fail to use ?x? as instructed)?


for any character:
=INDEX($A$1:$A$3,MATCH("*",$B$1:$B$3,0))

Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2


HI Claus
Thanks for you suggestion.

I slightly changed what you suggested to

=INDEX($A$1:$A$3|MATCH("*"|$B$1:$B$3|0))

It kinda worked however it gave me the value in A1 even when no
character was inserted.
It seems that the "*" also allows for a blank entry.

Thanks
Eddie


All times are GMT +1. The time now is 08:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com