PDA

View Full Version : Make decisions



sasa
05-30-2008, 10:19 PM
Hi All,
it is a lot of time I am thinking about this question.
Is it possible to arrange a formula or a nacro able to make choises.
For example if I have a1=red, a2=blue, a3=black, a4= green it should work this way: If a1=red then a2 should be equal to blue, but if blue is missing, then a2 should be equal to black, if a2= blue then a3 sholud be equal to black but if blak is missing then a3 = green and so on in a circular way.
The same also if two items are missing, for example is a1= red then a4=green and so on.

thanks for any help

sasa

Bob Phillips
05-31-2008, 01:42 AM
You say if a1=red then a2 should be blue, but then say that if blue is missing then a2 should be black. Missing, how? If we are setting it to blue, how can it be missing.

And is a1 a fixed value or do you expect it to be dependent upon A2, a3, a4 thereby giving a circular formula?

sasa
05-31-2008, 03:08 AM
Hi Xld,
be patient with me....
Well, my idea is like this.
I can put four items everyone in a cell. Maybe g1=red, g2= black, g3=blue, g4= green.
I write these items in a text format. It is possible that I also leave one or more cell blank. After I run the macro and it loops inside these cells and gives
me the result as I said, one after another in a column (what I can say, maybe in b1,b2,b3,b4.

Is it possible ?

Thanks

sasa

Aussiebear
05-31-2008, 04:45 AM
Bob, I had to read this a couple of times before I have arrived at this understanding, that saya is either looking for a formula to validate a range of colours that should be A1= Red, A2 = Blue, A3 = Black, A4 = Green.

Then comes a series of conditions;
If A1 = Red and A2 <> Blue then A2 now = Black
If A1 = Red, A2 = Blue and A3 <> Black, Then A3 now = Green
If A1 = Red, A2 <> Blue and A3 <> Black, Then A4 = Green

or as a further development;

If A1 = Red and A2 <> Blue then A2 now = Black ' Do something

If A1 = Red, A2 = Blue and A3 <> Black, Then A3 now = Green ' Do something Else 1

If A1 = Red, A2 <> Blue and A3 <> Black, Then A4 = Green ' Do something Else 2

Mind you I couold have read this wrong too...

mdmackillop
05-31-2008, 05:49 AM
You could be right Ted (Aussie logic!) but I think we need the OP to provide a workbook with a couple of samples. otherwse we spend more time trying to comprehend the question than creating a solution.

Bob Phillips
05-31-2008, 10:01 AM
Here is my interpretation

sasa
05-31-2008, 11:04 PM
Good Morning Xld,
your interpretation works just I asked. Two things again. It would be useful to me it could work on an entire column taking every time the last value of the previous output and starting again from there.(the first output is now g1->g4, last value g4), so the second should be in g5->g8,, last value g8) the third in g9->g12, last value g12) and so on. Finally, is it possible to have the working sheet (your code) in a window I can call from any sheet I am working ?
Anyway there are no words that say thank you enough.

sasa