[Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register]

Author Message
frog_15537
General User

Joined: 13 Jan 2009
Posts: 8
Location: New Jersey

 Posted: Wed Sep 28, 2011 4:22 am    Post subject: (SOLVED)IF then statements Wonder if some one can help me with this spreadsheet problem. I have a spreadsheet with ten columns and lets say ten rows. I would like to compare the values in A1 through J1 against the value 1. If any value in any of those ten cells equals 1, I would like to place a “Y” in L1. If it none equal 1 I would like to place a “N” in L1. all ten values will be different so that there can only be one 1 if there are any. Can this be done? How? What I tried was If(A1:J1 =1; “Y”; “N”) what that give me is “#Value” Thanks for any help. BillLast edited by frog_15537 on Wed Sep 28, 2011 5:32 am; edited 1 time in total
Villeroy
Super User

Joined: 04 Oct 2004
Posts: 10065
Location: Germany

Posted: Wed Sep 28, 2011 4:56 am    Post subject:

 Quote: If(A1:J1 =1; “Y”; “N”)

If 10 values = 1 then Y else N
_________________
Rest in peace, oooforum.org
Get help on http://forum.openoffice.org
gerard24
OOo Enthusiast

Joined: 08 Jul 2011
Posts: 100
Location: France

Posted: Wed Sep 28, 2011 5:00 am    Post subject:

 Code: =IF(COUNTIF(A1:J1;1);"Y";"N")

COUNTIF(A1:J1;1) counts number of cells =1,
if the result is <>0, the IF function returns Y, is result of COUNTIF is 0, IF returns N.
_________________
LibreOffice 3.5.0 on Windows Vista
frog_15537
General User

Joined: 13 Jan 2009
Posts: 8
Location: New Jersey

 Posted: Wed Sep 28, 2011 5:10 am    Post subject: If then statement My apologies Villeroy but I don't understand what it is that you are suggesting. are you asking a questions about my if statement clarification I want to check each individual cell A1 through J1 against the value of 1. if in any one of those individual cells there is a 1, I want to put a Y in L1. Otherewise I want to put an N. I tried putting in the :"then" and the "else" in the statement but that doesn't help. Not sure what you meant by "10 values". My knowledge of Calc is very limited. thanks for trying Bill
frog_15537
General User

Joined: 13 Jan 2009
Posts: 8
Location: New Jersey

 Posted: Wed Sep 28, 2011 5:29 am    Post subject: If then statement thank you very muchy gerard24. that works just the way I wanted it too. thanks to all who looked and especially to those who answered me. Bill
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 8 Hours Page 1 of 1

 Jump to: Select a forum OpenOffice.org Forums----------------Setup and TroubleshootingOpenOffice.org WriterOpenOffice.org CalcOpenOffice.org ImpressOpenOffice.org DrawOpenOffice.org MathOpenOffice.org BaseOpenOffice.org Macros and APIOpenOffice.org Code Snippets Community Forums----------------General DiscussionSite Feedback
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum