Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Assigning value to text

I am looking to assign a value to a text string and then insert the
corresponding value into a cell

As follows:

A1 to A100 could equal "NO CHANGE" or "FOR CHANGE"
If A1 = "NO CHANGE" then I1 = "10" else if A1 = "FOR CHANGE" then I1 =
"20"
If A2 = "NO CHANGE" then I2 = "10" else if A2 = "FOR CHANGE" then I2 =
"20"

then this to loop until A100

any help will be gratefully received
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Assigning value to text

Give this a try...

=10+10*(A1="FOR CHANGE")

and copy it down as needed.

--
Rick (MVP - Excel)


"Robincambs" wrote in message
...
I am looking to assign a value to a text string and then insert the
corresponding value into a cell

As follows:

A1 to A100 could equal "NO CHANGE" or "FOR CHANGE"
If A1 = "NO CHANGE" then I1 = "10" else if A1 = "FOR CHANGE" then I1 =
"20"
If A2 = "NO CHANGE" then I2 = "10" else if A2 = "FOR CHANGE" then I2 =
"20"

then this to loop until A100

any help will be gratefully received


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Assigning value to text

Enter
=IF(A1="NO CHANGE",10,20)
and drag it down to A100.

Regards,
Stefi

€˛Robincambs€¯ ezt Ć*rta:

I am looking to assign a value to a text string and then insert the
corresponding value into a cell

As follows:

A1 to A100 could equal "NO CHANGE" or "FOR CHANGE"
If A1 = "NO CHANGE" then I1 = "10" else if A1 = "FOR CHANGE" then I1 =
"20"
If A2 = "NO CHANGE" then I2 = "10" else if A2 = "FOR CHANGE" then I2 =
"20"

then this to loop until A100

any help will be gratefully received

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Assigning value to text

On 22 Sep, 14:17, "Rick Rothstein"
wrote:
Give this a try...

=10+10*(A1="FOR CHANGE")

and copy it down as needed.

--
Rick (MVP - Excel)

"Robincambs" wrote in message

...



I am looking to assign a value to a text string and then insert the
corresponding value into a cell


As follows:


A1 to A100 could equal "NO CHANGE" or "FOR CHANGE"
If A1 = "NO CHANGE" then I1 = "10" else if A1 = "FOR CHANGE" then I1 =
"20"
If A2 = "NO CHANGE" then I2 = "10" else if A2 = "FOR CHANGE" then I2 =
"20"


then this to loop until A100


any help will be gratefully received- Hide quoted text -


- Show quoted text -


Thanks for the suggestion, it doesn't do what i was hoping. There are
2 possible entries of text "NO CHANGE" or "FOR CHANGE" the suggestion
you made only provives a result of 10

Thanks
Rob
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Assigning value to text

What I posted will return 20 if A1 contains "FOR CHANGE" and will return 10
otherwise. Perhaps you mean it returns 10 if A1 is blank? Try this then...

=IF(A1="","",10+10*(A1="FOR CHANGE"))

--
Rick (MVP - Excel)


"Robincambs" wrote in message
...
On 22 Sep, 14:17, "Rick Rothstein"
wrote:
Give this a try...

=10+10*(A1="FOR CHANGE")

and copy it down as needed.

--
Rick (MVP - Excel)

"Robincambs" wrote in message

...



I am looking to assign a value to a text string and then insert the
corresponding value into a cell


As follows:


A1 to A100 could equal "NO CHANGE" or "FOR CHANGE"
If A1 = "NO CHANGE" then I1 = "10" else if A1 = "FOR CHANGE" then I1 =
"20"
If A2 = "NO CHANGE" then I2 = "10" else if A2 = "FOR CHANGE" then I2 =
"20"


then this to loop until A100


any help will be gratefully received- Hide quoted text -


- Show quoted text -


Thanks for the suggestion, it doesn't do what i was hoping. There are
2 possible entries of text "NO CHANGE" or "FOR CHANGE" the suggestion
you made only provives a result of 10

Thanks
Rob




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Assigning value to text

On 22 Sep, 14:25, Stefi wrote:
Enter
=IF(A1="NO CHANGE",10,20)
and drag it down to A100.

Regards,
Stefi

„Robincambs” ezt ķrta:



I am looking to assign a value to a text string and then insert the
corresponding value into a cell


As follows:


A1 to A100 could equal "NO CHANGE" or "FOR CHANGE"
If A1 = "NO CHANGE" then I1 = "10" else if A1 = "FOR CHANGE" then I1 =
"20"
If A2 = "NO CHANGE" then I2 = "10" else if A2 = "FOR CHANGE" then I2 =
"20"


then this to loop until A100


any help will be gratefully received- Hide quoted text -


- Show quoted text -


Unfortunatly neither of those work - perhaps its due to me using
conditional formatting or dropdown lists?
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Assigning value to text

On 22 Sep, 14:47, "Rick Rothstein"
wrote:
What I posted will return 20 if A1 contains "FOR CHANGE" and will return 10
otherwise. Perhaps you mean it returns 10 if A1 is blank? Try this then...

=IF(A1="","",10+10*(A1="FOR CHANGE"))

--
Rick (MVP - Excel)

"Robincambs" wrote in message

...



On 22 Sep, 14:17, "Rick Rothstein"
wrote:
Give this a try...


=10+10*(A1="FOR CHANGE")


and copy it down as needed.


--
Rick (MVP - Excel)


"Robincambs" wrote in message


...


I am looking to assign a value to a text string and then insert the
corresponding value into a cell


As follows:


A1 to A100 could equal "NO CHANGE" or "FOR CHANGE"
If A1 = "NO CHANGE" then I1 = "10" else if A1 = "FOR CHANGE" then I1 =
"20"
If A2 = "NO CHANGE" then I2 = "10" else if A2 = "FOR CHANGE" then I2 =
"20"


then this to loop until A100


any help will be gratefully received- Hide quoted text -


- Show quoted text -


Thanks for the suggestion, it doesn't do what i was hoping. There are
2 possible entries of text "NO CHANGE" or "FOR CHANGE" the suggestion
you made only provives a result of 10


Thanks
Rob- Hide quoted text -


- Show quoted text -


Yes - that works great, how could i address 3 different conditions
such as NO CHANGE" or "FOR CHANGE" or "PENDING CHANGE"
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Assigning value to text


Unfortunatly neither of those work - perhaps its due to me using
conditional formatting or dropdown lists?


I don't think so, something else must be the problem, either Rick's solution
or mine should work, maybe your data contain some factor (case, redundant
spaces, etc.) Please post sample data!

Stefi

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Assigning value to text

It is usually easier if you follow the same posting method as the person who
responded to you... in my case, posting the responses at the top of the
message (that way the text is not bouncing back and forth from top to
bottom).

As for your problem... conditional formatting or dropdown lists should not
affect the formulas that have been posted from working. I am going to guess
that you have more in your cells than NO CHANGE or FOR CHANGE... perhaps
some extra spaces at the front or back?

--
Rick (MVP - Excel)


Unfortunatly neither of those work - perhaps its due to me using
conditional formatting or dropdown lists?


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Assigning value to text

Sorry about the user group etiquette, something i'm not farmiliar
with.

I have found your suggestion works fine - it was my formatting that
was at fault.

how could i address 3 different conditions and assign 3 values
such as NO CHANGE" = 10 or "FOR CHANGE" = 20 or "PENDING CHANGE" = 30

Kind regards
Rob

On 22 Sep, 15:05, "Rick Rothstein"
wrote:
It is usually easier if you follow the same posting method as the person who
responded to you... in my case, posting the responses at the top of the
message (that way the text is not bouncing back and forth from top to
bottom).

As for your problem... conditional formatting or dropdown lists should not
affect the formulas that have been posted from working. I am going to guess
that you have more in your cells than NO CHANGE or FOR CHANGE... perhaps
some extra spaces at the front or back?

--
Rick (MVP - Excel)



Unfortunatly neither of those work - perhaps its due to me using
conditional formatting or dropdown lists?- Hide quoted text -


- Show quoted text -




  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Assigning value to text

You should always ask for what you want initially and not simplify your
requests for us... the nature of formula (and even macro) solutions are that
they tend to be good only for the conditions they were designed to handle
and no more. For your current question, which did not tell us what you
wanted for the PENDING CHANGE condition (so I assumed 30 in my sample
formula), try this...

=IF(A1="","",IF(A1="NO CHANGE",10,IF(A1="FOR CHANGE",20,30)))

--
Rick (MVP - Excel)

Yes - that works great, how could i address 3 different conditions
such as NO CHANGE" or "FOR CHANGE" or "PENDING CHANGE"


  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Assigning value to text

Super - thanks Rick, i have learnt a few lessons today...!



On 22 Sep, 15:29, "Rick Rothstein"
wrote:
You should always ask for what you want initially and not simplify your
requests for us... the nature of formula (and even macro) solutions are that
they tend to be good only for the conditions they were designed to handle
and no more. For your current question, which did not tell us what you
wanted for the PENDING CHANGE condition (so I assumed 30 in my sample
formula), try this...

=IF(A1="","",IF(A1="NO CHANGE",10,IF(A1="FOR CHANGE",20,30)))

--
Rick (MVP - Excel)



Yes - that works great, how could i address 3 different conditions
such as NO CHANGE" or "FOR CHANGE" or "PENDING CHANGE"- Hide quoted text -


- Show quoted text -


  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Assigning value to text

=IF(A1="NO CHANGE",10,IF(A1="FOR CHANGE",20,30))
Regards,
Stefi


€˛Robincambs€¯ ezt Ć*rta:

Sorry about the user group etiquette, something i'm not farmiliar
with.

I have found your suggestion works fine - it was my formatting that
was at fault.

how could i address 3 different conditions and assign 3 values
such as NO CHANGE" = 10 or "FOR CHANGE" = 20 or "PENDING CHANGE" = 30

Kind regards
Rob

On 22 Sep, 15:05, "Rick Rothstein"
wrote:
It is usually easier if you follow the same posting method as the person who
responded to you... in my case, posting the responses at the top of the
message (that way the text is not bouncing back and forth from top to
bottom).

As for your problem... conditional formatting or dropdown lists should not
affect the formulas that have been posted from working. I am going to guess
that you have more in your cells than NO CHANGE or FOR CHANGE... perhaps
some extra spaces at the front or back?

--
Rick (MVP - Excel)



Unfortunatly neither of those work - perhaps its due to me using
conditional formatting or dropdown lists?- Hide quoted text -


- Show quoted text -



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assigning a number value to text SoupNazi Excel Worksheet Functions 6 April 22nd 23 06:12 AM
assigning numbers to text and count the text gimme_donuts[_2_] Excel Discussion (Misc queries) 2 January 5th 09 09:50 AM
IF Then using a column of text and assigning a number to text Dan Excel Discussion (Misc queries) 5 August 20th 08 11:24 PM
assigning text box input to a sheet [email protected] Excel Programming 1 April 26th 07 07:17 AM
Assigning numerical value to text Dave Excel Worksheet Functions 11 February 1st 07 02:21 AM


All times are GMT +1. The time now is 10:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"