+ Reply to Thread
Results 1 to 69 of 69

Find last occurance of text in range

  1. #1
    Registered User
    Join Date
    08-26-2005
    Posts
    4

    Angry Find last occurance of text in range

    I need to find the last occurance of text in a range of cells. The range can have empty cells and various text values. This is a project staff schedule and I want to have a formula that will display the Last Sick Day and Next Vacation Day.

    Column A, Row 2 contains the consultant name
    Row 1 contains the date (each day from project start to project end)
    Intersecting sells contain "MC" for a sick day and "H" for a vacation day or blank for neither.

    In laymans terms:
    For Last Sick Day I want to look at today's date, search across Row 5 to find that date, go backwards in time (columns) to find the cell reference for the last occurance of "MC" and return the date value from Row 5.

    For Next Vacation Day I want to look at today's date, search across Row 5 to find that date, go forward in time (colums) to find the cell reference for the next occurance of "H" and return the date value from Row 5.

    I've tried FIND, MATCH (returns the first occurance and doesn't seem to work across empty cells) and LOOKUP. My guess is that this will involve a HLOOKUP and possibly MAX but I am lost.

    Any help, pointers or a nice cold beer are appreciated! My project team is large and we want to make sure we control their movements well.

    Cheers,
    Andy

  2. #2
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  3. #3
    Registered User
    Join Date
    08-26-2005
    Posts
    4

    Thanks but....

    Thanks Bob. Wicked stuff. I hope you don't mind me asking for another point of clarification so here goes.

    For the Previous MC and Next Holiday formulae, they are the same in your message so I changed the Next Holiday to read:

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No planned holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1)))

    The problem is that it does find the next holiday but since its >=TODAY, it returns the last day of the next holiday. I need it to return the first day. If you have a different formula for this and could post it, that would be great. Time for me to pick up a good book on Excel covering formulae and arrays.

    Cheers,
    Andy
    Last edited by farutherford; 08-27-2005 at 05:45 AM.

  4. #4
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  5. #5
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  6. #6
    Registered User
    Join Date
    08-26-2005
    Posts
    4

    Thumbs up Thanks!

    Thanks a ton Bob. The forumla worked great and now I understand arrays just a little bit better.


  7. #7
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  8. #8
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  9. #9
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  10. #10
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  11. #11
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  12. #12
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  13. #13
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  14. #14
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  15. #15
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  16. #16
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  17. #17
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  18. #18
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  19. #19
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  20. #20
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  21. #21
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  22. #22
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  23. #23
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  24. #24
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  25. #25
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  26. #26
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  27. #27
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  28. #28
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  29. #29
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  30. #30
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  31. #31
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  32. #32
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  33. #33
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  34. #34
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  35. #35
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  36. #36
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  37. #37
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  38. #38
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  39. #39
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  40. #40
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  41. #41
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  42. #42
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  43. #43
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  44. #44
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  45. #45
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  46. #46
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  47. #47
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  48. #48
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  49. #49
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  50. #50
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  51. #51
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  52. #52
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  53. #53
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  54. #54
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  55. #55
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  56. #56
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  57. #57
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  58. #58
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  59. #59
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  60. #60
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  61. #61
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  62. #62
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  63. #63
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  64. #64
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




  65. #65
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  66. #66
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  67. #67
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    Last sickness

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Next holiday

    =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1<=TODAY())*(2:2="MC"),2:2),1)),"No
    previous
    sickness",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1<=TODAY())*(2:2="MC"),2:2)
    ,1)))

    Both are array formulae, so commit with Ctrl-Shift-End

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I need to find the last occurance of text in a range of cells. The
    > range can have empty cells and various text values. This is a project
    > staff schedule and I want to have a formula that will display the Last
    > Sick Day and Next Vacation Day.
    >
    > Column A, Row 2 contains the consultant name
    > Row 1 contains the date (each day from project start to project end)
    > Intersecting sells contain "MC" for a sick day and "H" for a vacation
    > day or blank for neither.
    >
    > In laymans terms:
    > For Last Sick Day I want to look at today's date, search across Row 5
    > to find that date, go backwards in time (columns) to find the cell
    > reference for the last occurance of "MC" and return the date value from
    > Row 5.
    >
    > For Next Vacation Day I want to look at today's date, search across Row
    > 5 to find that date, go forward in time (colums) to find the cell
    > reference for the next occurance of "H" and return the date value from
    > Row 5.
    >
    > I've tried FIND, MATCH (returns the first occurance and doesn't seem to
    > work across empty cells) and LOOKUP. My guess is that this will involve
    > a HLOOKUP and possibly MAX but I am lost.
    >
    > Any help, pointers or a nice cold beer are appreciated! My project
    > team is large and we want to make sure we control their movements
    > well.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  68. #68
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Andy,

    You can't use LOOKUP this way as it finds the highest instance less that the
    search value after TODAY(), whereas you want the first instance after
    TODAY().

    It can be done though ( and I did work it out last time, just messed up the
    cut and paste :-(), with

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))

    again an array formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "farutherford" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > point of clarification so here goes.
    >
    > For the Previous MC and Next Holiday formulae, they are the same in
    > your message so I changed the Next Holiday to read:
    >
    > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > planned
    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    )))
    >
    > The problem is that it does find the next holiday but since its
    > >=TODAY, it returns the last day of the next holiday. I need it to

    > return the first day. If you have a different formula for this and
    > could post it, that would be great. Time for me to pick up a good book
    > on Excel covering formulae and arrays.
    >
    > Cheers,
    > Andy
    >
    >
    > --
    > farutherford
    > ------------------------------------------------------------------------
    > farutherford's Profile:

    http://www.excelforum.com/member.php...o&userid=26663
    > View this thread: http://www.excelforum.com/showthread...hreadid=399389
    >




  69. #69
    Bob Phillips
    Guest

    Re: Find last occurance of text in range

    Sorry, a small typo

    =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),0)),"No planned
    holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Andy,
    >
    > You can't use LOOKUP this way as it finds the highest instance less that

    the
    > search value after TODAY(), whereas you want the first instance after
    > TODAY().
    >
    > It can be done though ( and I did work it out last time, just messed up

    the
    > cut and paste :-(), with
    >
    > =IF(ISNA(MATCH("H",IF(($1:$1>=TODAY())*(2:2="H"),2:2),1)),"No planned
    > holiday",INDEX($1:$1,MATCH("H",IF((1:1>=TODAY())*(2:2="H"),2:2),0)))
    >
    > again an array formula.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "farutherford" <[email protected]>
    > wrote in message
    > news:[email protected]...
    > >
    > > Thanks Bob. Wicked stuff. I hope you don't mind me asking for another
    > > point of clarification so here goes.
    > >
    > > For the Previous MC and Next Holiday formulae, they are the same in
    > > your message so I changed the Next Holiday to read:
    > >
    > > =IF(ISNA(MATCH("ZZZZZZZZZZZZ",IF(($1:$1>=TODAY())*(2:2="h"),2:2),1)),"No
    > > planned
    > >

    >

    holiday",INDEX($1:$1,MATCH("ZZZZZZZZZZZZ",IF((1:1>=TODAY())*(2:2="h"),2:2),1
    > )))
    > >
    > > The problem is that it does find the next holiday but since its
    > > >=TODAY, it returns the last day of the next holiday. I need it to

    > > return the first day. If you have a different formula for this and
    > > could post it, that would be great. Time for me to pick up a good book
    > > on Excel covering formulae and arrays.
    > >
    > > Cheers,
    > > Andy
    > >
    > >
    > > --
    > > farutherford
    > > ------------------------------------------------------------------------
    > > farutherford's Profile:

    > http://www.excelforum.com/member.php...o&userid=26663
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=399389
    > >

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1