Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: Next incidence in row 1

Status
Not open for further replies.

jonsi

IS-IT--Management
Dec 20, 2001
1,989
DE
I have a fleet service scheduler on a spreadsheet that resembles a year-planner. To get it to do what I want I'd have to have a vast number of cells each containing IF statements which is stupid to say the least and unwieldy at best.

Scheduled vehicle services are marked in date headed columns with the letter "S" entered into the cell, once completed this is manually changed to a "C" leaving the remaining "S" cells alone.

Vehicle 12/07 13/07 14/07
ABC 123 C C S
DEF 456 C S S
XYZ 999 S S S

Using a straightforward LOOKUP I can always return the Cell address (or an OFFSET based on it) of the last incidence of "C" in a row, but I cannot seem to find a way of returning the Cell address of the next (ie first) incidence of "S" in the row.
eg within the range above I should return D2 for Row B2:D2, C3 for B3:D3 and B4 for B4:D4. If I changed B4 to "C" the result should then return C4.

I'm sure I'm missing something really basic but I'm going round in circles with this one (could be the weather here ATM). Can someone help point me in the right direction please ?

thanks
Jonsi
 
Jonsi - have a look at the MATCH function within each row

=MATCH("S",B2:D2,0)

will return "3" as it is in the 3rd column of the data set

=MATCH("S",A2:D2,0)

will return "4"

Use this and the ADDRESS function to create the cell ref

For row 2, I would use

=ADDRESS(ROW(),MATCH("S",A1:D1,0),1,1)

Rgds, Geoff

Three things are certain. Death, taxes and lost data. DPlank is to blame

Please read FAQ222-2244 before you ask a question
 
Thanks Geoff,

As usual ...100% correct :)

Had completely forgotten about the MATCH Function. This works a treat and gives me exactly what I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top