Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I am trying to re-create a brain teaser from the newspaper on an excel spread
sheet. The aim is to have two rows and two columns of numbers interlaced and the four mathmatical symbols used once each so that both the rows and columns sum to the same amount. e.g. (this is not solved!) 2 10 6 / 2 - 2 2 2 3 + 2 * 2 1 1 I would like to put mathmatical symbols in cells to form each equation, so that I can change the symbol and both row and coloumn up-dates. Has anyone done something like this? Thanks. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Consider the following User Defined Function:
Function equa(r1 As Range, r2 As Range, r3 As Range) As Variant v1 = r1.Value v2 = r2.Value v3 = r3.Value equa = Evaluate(v1 & v2 & v3) End Function So if A1 contains 1 and B1 contains + and C1 contains 2 then =equa(A1,B1,C1) will return 3 You can change the symbol in B1 to - or / or * or ^ User Defined Functions (UDFs) are very easy to install and use: 1. ALT-F11 brings up the VBE window 2. ALT-I ALT-M opens a fresh module 3. paste the stuff in and close the VBE window If you save the workbook, the UDF will be saved with it. To remove the UDF: 1. bring up the VBE window as above 2. clear the code out 3. close the VBE window To use the UDF from Excel: =equa(A1,B1,C1) To learn more about macros in general, see: http://www.mvps.org/dmcritchie/excel/getstarted.htm or http://www.cpearson.com/excel/Writin...ionsInVBA.aspx for specifics on UDFs -- Gary''s Student - gsnu200823 "GO" wrote: I am trying to re-create a brain teaser from the newspaper on an excel spread sheet. The aim is to have two rows and two columns of numbers interlaced and the four mathmatical symbols used once each so that both the rows and columns sum to the same amount. e.g. (this is not solved!) 2 10 6 / 2 - 2 2 2 3 + 2 * 2 1 1 I would like to put mathmatical symbols in cells to form each equation, so that I can change the symbol and both row and coloumn up-dates. Has anyone done something like this? Thanks. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() Hi. I pulled up all "permutations" of "+-*/" and even "+-*/^" and did not show a solution. Are you sure you copied the problem correctly? - - - Dana DeLouis GO wrote: I am trying to re-create a brain teaser from the newspaper on an excel spread sheet. The aim is to have two rows and two columns of numbers interlaced and the four mathmatical symbols used once each so that both the rows and columns sum to the same amount. e.g. (this is not solved!) 2 10 6 / 2 - 2 2 2 3 + 2 * 2 1 1 I would like to put mathmatical symbols in cells to form each equation, so that I can change the symbol and both row and coloumn up-dates. Has anyone done something like this? Thanks. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Jan 2, 9:13*am, Dana DeLouis wrote:
Hi. *I pulled up all "permutations" of "+-*/" and even "+-*/^" and did not show a solution. *Are you sure you copied the problem correctly? - - - Dana DeLouis Are you sure, Dana? Left to right, then top to bottom: +/*- =4 |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi. Thanks. Maybe I don't understand the question.
I take it one replaces all of the + - * / that are listed with different permutations. {"2+2-1", "10*2/1", "6+2*2", "3-2/2"}, {"2+2-1", "10/2*1", "6+2/2", "3-2*2"}, {"2+2*1", "10-2/1", "6+2-2", "3*2/2"}, {"2+2*1", "10/2-1", "6+2/2", "3*2-2"}... ....etc I didn't show any that were all equal numerically. Even if duplicates were allowed, I didn't get an answer. I'll try some more ideas. Thanks. :) Spiky wrote: On Jan 2, 9:13 am, Dana DeLouis wrote: Hi. I pulled up all "permutations" of "+-*/" and even "+-*/^" and did not show a solution. Are you sure you copied the problem correctly? - - - Dana DeLouis Are you sure, Dana? Left to right, then top to bottom: +/*- =4 |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Jan 2, 10:24*am, Dana DeLouis wrote:
Hi. Thanks. *Maybe I don't understand the question. {"2+2*1", "10/2-1", "6+2/2", "3*2-2"}... Maybe you should check this one again. Note this always goes in order since it is a little brain teaser game, it doesn't follow the "*/ before +-" rule of algebra. :-) |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Oh! I see. The rows can total to a different value than the columns.
I thought both rows and columns had to total to the same value. My mistake. {"2+2+1", "10/2*1", "6+2/2", "3+2*2"}, {"2+2+1", "10/2^1", "6+2/2", "3+2^2"}, {"2+2^1", "10/2-1", "6+2/2", "3^2-2"} ect... Dana DeLouis <snip Spiky wrote: On Jan 2, 9:13 am, Dana DeLouis wrote: Hi. I pulled up all "permutations" of "+-*/" and even "+-*/^" and did not show a solution. Are you sure you copied the problem correctly? - - - Dana DeLouis Are you sure, Dana? Left to right, then top to bottom: +/*- =4 |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Jan 2, 10:42*am, Dana DeLouis wrote:
Oh! *I see. *The rows can total to a different value than the columns.. I thought both rows and columns had to total to the same value. *My mistake. No, you had the premise correct, according to the OP's description. Maybe you just missed a calc somewhere. As I said, the correct signs a + / * - 2+2*1=4 10/2-1=4 6+2/2=4 3*2-2=4 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Mathmatical functions in Excel | Excel Worksheet Functions | |||
Symbols inside cells | Excel Discussion (Misc queries) | |||
symbols in cells | Excel Discussion (Misc queries) | |||
mathmatical error | Excel Worksheet Functions | |||
How to set up a graph for mathmatical graphing | Setting up and Configuration of Excel |