iaudio1233
Board Regular
- Joined
- Mar 7, 2014
- Messages
- 158
Hi, I have some calculation cases as follows which is common in primary school lessons.
<tbody>
</tbody>
there are about 64 combinations to calculate the cells. like +++ ++- ++x ++÷...............
I used "nested if" for case 1 like ( =if(and(b1="+",d1="+",f1="+"),a1+c1+e1,"")&if(and(b1="+",d1="+",f1="-"),a1+c1-e1,"")&if(...................................)
since there are about 10 cases as above as the brackets position change , and each has about 64 combinations. the formula becomes tremendously cumbersome.
Please advise how to shorten the nested ifs or create UDF to solve such problems.
Thanks
1 | + | 2 | + | 3 | + | 4 |
1 | x | ( | 2 | + | 3 | ) |
( | 1 | + | 2 | ) | x | 4 |
<tbody>
</tbody>
there are about 64 combinations to calculate the cells. like +++ ++- ++x ++÷...............
I used "nested if" for case 1 like ( =if(and(b1="+",d1="+",f1="+"),a1+c1+e1,"")&if(and(b1="+",d1="+",f1="-"),a1+c1-e1,"")&if(...................................)
since there are about 10 cases as above as the brackets position change , and each has about 64 combinations. the formula becomes tremendously cumbersome.
Please advise how to shorten the nested ifs or create UDF to solve such problems.
Thanks