On Monday 30 Jul 2007, Scott Castaline wrote (regarding [users] Creating a 
formula based on a condition):
> Just wanted to thank Ken Burnside, Harold Fuchs, and Brian Barker for
> their quick responses. I had originally tried Ken's solution, nesting 3
> IF statements, which worked very well. However I settled with Brian's
> solution, for a couple of reasons. 1. I'm a lazy/bad typist, 2. The fact
> that "State" was common to all 3 situations that resulted in H16 to =
> 135, resulted in a nice simple solution that will also work if a 4th or
> 5th variant of State comes along.
>
> The second problem solution offered by Brian Seems good. However I would
> like to write a macro that would automate it somewhat. I had already
> created 3 named ranges from the Master list. I've been reading the book
> by Dr. Mark Bain "OpenOffice.org Spreadsheet Macro Programming", and I
> got lost in the oDoc, oSheet, and the oRange funtions in UNO. For now
> I'll just stick with the copy and special paste method.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

Scott,

I see that you have had responses from multiple folks, and also implemented 
some answers from them to solve your problem.  Therefore, I apologize for the 
delay in response (I live in India, so, time-zone difference + laziness = 
delay)

Here is one more method of doing the same:

Put the value that you want to search in a specific cell (say, A1)
Then, for each of the cells (say H2) that you want to change the value, put in 
the following:
=IF(ISERROR(FIND($A$1;C2));0;135)

Explanations:
The FIND() finds [what else?] the occurrence of the contents of A1 in the 
reference cell (C2).  If found, FIND() returns the position where it was 
found.  If not found, FIND() returns an error, which is trapped by the 
ISERROR() function.  If ISERROR() returns TRUE [i.e., the FIND() was not 
successful], then the IF() function puts in a ZERO into the cell.  IF the 
ISERROR() function returns a FALSE [viz, the FIND() was able to find the 
string], then, the value of 135 is put into the cell.

Trust that this also helps.  And, once again, sorry for the delay.
-- 
Pradeep Srinivas
Bangalore, India

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to