#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default categorical variable

Dear Experts,
If I have a categorical variable (1 and 2), how can I inform excel
that 1 means Male and 2 means Female?
Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default categorical variable

With an IF statement.

dim myVar as long
dim myStr as long

myVar = 1

if myvar = 1 then
mystr = "Male"
else
mystr = "Female"
end if

====
assumes that there are only two options for that variable.


Omar wrote:

Dear Experts,
If I have a categorical variable (1 and 2), how can I inform excel
that 1 means Male and 2 means Female?
Thanks.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default categorical variable

Hi

=If(A1=1,"Male,if(A1=2,"Female,""))

--
Regards

Roger Govier


"Omar" wrote in message
oups.com...
Dear Experts,
If I have a categorical variable (1 and 2), how can I inform excel
that 1 means Male and 2 means Female?
Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default categorical variable

Or perhaps shuffle the quote marks:
=If(A1=1,"Male",if(A1=2,"Female,"))
--
David Biddulph

"Roger Govier" wrote in message
...
Hi

=If(A1=1,"Male,if(A1=2,"Female,""))

--
Regards

Roger Govier


"Omar" wrote in message
oups.com...
Dear Experts,
If I have a categorical variable (1 and 2), how can I inform excel
that 1 means Male and 2 means Female?
Thanks.



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default categorical variable

My fingers not typing what brain is thinking again - perhaps yours
also<bg


=If(A1=1,"Male",if(A1=2,"Female",""))


--
Regards

Roger Govier


"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
Or perhaps shuffle the quote marks:
=If(A1=1,"Male",if(A1=2,"Female,"))
--
David Biddulph

"Roger Govier" wrote in message
...
Hi

=If(A1=1,"Male,if(A1=2,"Female,""))

--
Regards

Roger Govier


"Omar" wrote in message
oups.com...
Dear Experts,
If I have a categorical variable (1 and 2), how can I inform excel
that 1 means Male and 2 means Female?
Thanks.





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
Pivot table puzzle: "Top 10" for categorical data Tyla Excel Discussion (Misc queries) 0 April 6th 07 07:42 PM
How to use excel statistics for categorical data? Zafer Excel Discussion (Misc queries) 1 January 22nd 07 12:40 PM
How to plot categorical data to show confidence interval? Question... Excel Discussion (Misc queries) 0 April 26th 06 05:28 AM
Sum cells based on a row variable and seperate column variable CheeseHeadTransplant Excel Worksheet Functions 10 September 23rd 05 06:59 PM
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? Daniel Excel Worksheet Functions 1 July 9th 05 03:05 AM


All times are GMT +1. The time now is 07:23 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"