Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
billybob
 
Posts: n/a
Default I need help assigning a value to a character


I need to format a cell so that if I enter an upper case "Y" it displays
the "Y" but the cell thinks the value of the "Y" is "1" so that it can
be added in another function elsewhere. I have tried to use the "IF"
functions but have had no success as of yet. HELP!


--
billybob
------------------------------------------------------------------------
billybob's Profile: http://www.excelforum.com/member.php...o&userid=26610
View this thread: http://www.excelforum.com/showthread...hreadid=398817

  #2   Report Post  
Jim May
 
Posts: n/a
Default

in cell a11 type in
=SUM(IF(A1:A10="Y",1,0)) as one line;
DO NOT PRESS ENTER
but instead press simultaneously the CONTROL KEY + SHIFTKEY+ENTER
This will create a Control array formula (CSE).
HTH



"billybob" wrote in
message ...

I need to format a cell so that if I enter an upper case "Y" it displays
the "Y" but the cell thinks the value of the "Y" is "1" so that it can
be added in another function elsewhere. I have tried to use the "IF"
functions but have had no success as of yet. HELP!


--
billybob
------------------------------------------------------------------------
billybob's Profile:
http://www.excelforum.com/member.php...o&userid=26610
View this thread: http://www.excelforum.com/showthread...hreadid=398817



  #3   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

BillyBob,

If the cell contains a Y, it contains a Y. You'd use an IF in a formula
elsewhere that want's to know, like:

=IF(A1 = "Y", 1, 0)

That one isn't case-sensitive. For upper-case Y only, use:

=IF( CODE(A1) = 89, 1, 0)
--
Earl Kiosterud
www.smokeylake.com

"billybob" wrote in
message ...

I need to format a cell so that if I enter an upper case "Y" it displays
the "Y" but the cell thinks the value of the "Y" is "1" so that it can
be added in another function elsewhere. I have tried to use the "IF"
functions but have had no success as of yet. HELP!


--
billybob
------------------------------------------------------------------------
billybob's Profile:
http://www.excelforum.com/member.php...o&userid=26610
View this thread: http://www.excelforum.com/showthread...hreadid=398817



  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

I don't think you'll succeed with formatting alone.

But you could use a helper cell:
=if(a1="y",1,0)

You could put this in column B and hide that column, but use B1 for the
subsequent formulas.



billybob wrote:

I need to format a cell so that if I enter an upper case "Y" it displays
the "Y" but the cell thinks the value of the "Y" is "1" so that it can
be added in another function elsewhere. I have tried to use the "IF"
functions but have had no success as of yet. HELP!

--
billybob
------------------------------------------------------------------------
billybob's Profile: http://www.excelforum.com/member.php...o&userid=26610
View this thread: http://www.excelforum.com/showthread...hreadid=398817


--

Dave Peterson
  #5   Report Post  
Dave Peterson
 
Posts: n/a
Default

Just this portion:

=IF( CODE(A1) = 89, 1, 0)


Maybe:

=IF(CODE(A1) = code("Y"), 1, 0)
or to avoid an error if A1 is empty:
=IF(CODE(A1&" ") = code("Y"), 1, 0)

Just a little easier to read (for me anyway).

And one more way:

=if(EXACT(A1,"Y")=True,1,0)
or
=--EXACT(A1,"Y")



Earl Kiosterud wrote:

BillyBob,

If the cell contains a Y, it contains a Y. You'd use an IF in a formula
elsewhere that want's to know, like:

=IF(A1 = "Y", 1, 0)

That one isn't case-sensitive. For upper-case Y only, use:

=IF( CODE(A1) = 89, 1, 0)
--
Earl Kiosterud
www.smokeylake.com

"billybob" wrote in
message ...

I need to format a cell so that if I enter an upper case "Y" it displays
the "Y" but the cell thinks the value of the "Y" is "1" so that it can
be added in another function elsewhere. I have tried to use the "IF"
functions but have had no success as of yet. HELP!


--
billybob
------------------------------------------------------------------------
billybob's Profile:
http://www.excelforum.com/member.php...o&userid=26610
View this thread: http://www.excelforum.com/showthread...hreadid=398817


--

Dave Peterson


  #6   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

Dave,

Oops. You're absolutely right. I didn't test it with an empty cell.

We can shorten =IF(EXACT(A1,"Y")=TRUE,1,0)
to =IF(EXACT(A1,"Y"),1,0)

=--EXACT(A1,"Y") is very cool, but a bit more cryptic for some.

The real heck of it is that the OP may realize that demanding an upper-case
Y may cause problems when users use lower-case, and he'll change the
requirement. After all our work, we'll wind up with good old

=IF(A1 = "Y", 1, 0)

:)

--
Earl Kiosterud
www.smokeylake.com

"Dave Peterson" wrote in message
...
Just this portion:

=IF( CODE(A1) = 89, 1, 0)


Maybe:

=IF(CODE(A1) = code("Y"), 1, 0)
or to avoid an error if A1 is empty:
=IF(CODE(A1&" ") = code("Y"), 1, 0)

Just a little easier to read (for me anyway).

And one more way:

=if(EXACT(A1,"Y")=True,1,0)
or
=--EXACT(A1,"Y")



Earl Kiosterud wrote:

BillyBob,

If the cell contains a Y, it contains a Y. You'd use an IF in a formula
elsewhere that want's to know, like:

=IF(A1 = "Y", 1, 0)

That one isn't case-sensitive. For upper-case Y only, use:

=IF( CODE(A1) = 89, 1, 0)
--
Earl Kiosterud
www.smokeylake.com

"billybob" wrote
in
message ...

I need to format a cell so that if I enter an upper case "Y" it
displays
the "Y" but the cell thinks the value of the "Y" is "1" so that it can
be added in another function elsewhere. I have tried to use the "IF"
functions but have had no success as of yet. HELP!


--
billybob
------------------------------------------------------------------------
billybob's Profile:
http://www.excelforum.com/member.php...o&userid=26610
View this thread:
http://www.excelforum.com/showthread...hreadid=398817


--

Dave Peterson



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
How to assign character (text) values to y-axis in a Excel chart? cy Charts and Charting in Excel 1 July 16th 05 10:39 PM
install Office Assistant character file? billcamp Excel Discussion (Misc queries) 2 April 8th 05 01:39 PM
Copy a column in worksheet with a character change photowiz Excel Worksheet Functions 1 February 5th 05 03:35 PM
Searching a cell for a certain character. Matt Excel Worksheet Functions 3 January 3rd 05 09:14 PM
Removing ' character from cells Don Excel Discussion (Misc queries) 5 December 21st 04 05:41 PM


All times are GMT +1. The time now is 11:31 PM.

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"