[Solved] Excel formula for cellular automata rules

Discuss the spreadsheet application
Post Reply
Melissa_23
Posts: 2
Joined: Fri Sep 14, 2018 3:10 pm

[Solved] Excel formula for cellular automata rules

Post by Melissa_23 »

Hello there :)
In the attached image I'm trying make a formula for the following rules in open office calc with a cellular automata mathematical equation.

So far I have done this:

=IF(AND(D4='S',OR(C4='S', E4='S')),'O', IF(AND(D4='O',OR(COUNTIF(C4:E4;"<>O"))),'O','S'))

It keeps coming up with an error #508 or #REF! and I'm really stuck of where exactky I'm going wrong.
If anyone has any ideas it's be very much appreciated :)
Attachments
01.png
Last edited by Hagar Delest on Sat Sep 15, 2018 10:27 pm, edited 2 times in total.
Reason: tagged solved
OpenOffice 3.1 on Windows 10
FJCC
Moderator
Posts: 9278
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Help with excel formula for cellular automata rules

Post by FJCC »

If you are really using OpenOffice Calc and not Excel, then the parameters in your formula need to be separated by semicolons and not commas. Also, text has to be surrounded by double quotes. Try

Code: Select all

=IF(AND(D4="S";OR(C4="S"; E4="S"));"O"; IF(AND(D4="O";OR(COUNTIF(C4:E4;"<>O")));"O";"S"))
This part of the formula doesn't make sense to me

Code: Select all

OR(COUNTIF(C4:E4;"<>O"))
OR() with only one argument is no different that just using the argument.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
MrProgrammer
Moderator
Posts: 4908
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Help with excel formula for cellular automata rules

Post by MrProgrammer »

Hi, and welcome to the forum.
Melissa_23 wrote:I'm trying to write up an excel formula …
This forum is for Calc, not for Excel. For Calc, assuming g(x-1), g(x), and g(x+1) are in C4, D4, and E4, use =IF(ISODD(COUNTIF(C4:E4;"S"));"O";"S").

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Melissa_23
Posts: 2
Joined: Fri Sep 14, 2018 3:10 pm

Re: Help with excel formula for cellular automata rules

Post by Melissa_23 »

Thanks so much for your help :)
OpenOffice 3.1 on Windows 10
Post Reply