Index & Match for finding start & end dates based on contents in first & last cells in rows

Mickdelo

New Member
Joined
Feb 27, 2009
Messages
13
Dear All,

I am trying to come out with a formula that will assist in generating the start date and end date per row for different positions.
Try using the Index & Match formula but there is a problem with the Match type when using with numbers less than 1.

Formula used in typical row in cell C7 to generate Early Start date is: =IFERROR(IF(SUM(E7:M7)=0,0,INDEX(E$3:M$3,1,MATCH(1,E7:M7,0))),IF(SUM(E7:M7)=0,0,INDEX(E$3:M$3,1,MATCH(1,E7:M7,1))))
Formula used in typical row in cell E7 to generate Early Finish date is:
=IF(SUM(E7:M7)=0,0,INDEX(E$4:M$4,1,MATCH(1,E7:M7,1)))

See below sample where date generated in Row 7 Cell C7 is working i.e. it generates the Early Start as being 01-Nov-11 because the first Cell in Row 7 that has a 1 in it corresponds with the 01-Nov-11 date in Row 3.
Similarly Early Finish is correct as it is picking up the last cell with a 1 in it in Row 7 and returning the corresponding date in Row 4 i.e. 31-Mar-12.
However the formula are not working for cells with numbers using number less than 1 - see Cells C8 and D8 where C8 should be 01-Nov-11 but is showing 01-Apr-12. think this is because some of the numbers in cells are less than 1 e.g. 0.3
Any solutions to generate correct dates based on first cell and last cell entries would be much appreciated.

1ABCDEFGHIJKLMN
2ITEMActivityEarlyEarlyM1M2M3M4M5M6M7M8M9Total
3StartFinishSep-11Oct-11Nov-11Dec-11Jan-12Feb-12Mar-12Apr-12May-12Mths
4Sep-11Oct-11Nov-11Dec-11Jan-12Feb-12Mar-12Apr-12May-12
5
6Management1.002.404.004.004.501.300.8018.00
7Project Manager1-Nov-1131-Mar-121.001.001.001.001.005.00
8Engineer1-Apr-1230-Apr-120.300.300.300.300.300.301.80
9Doctor1-Dec-1129-Feb-121.001.001.003.00
10Nurse1-Dec-1129-Feb-120.401.001.001.003.40
11Assistant1-Feb-1230-Apr-120.500.500.501.000.503.00
12Driver1-Oct-1129-Feb-121.000.200.200.200.201.80
13

<tbody>
</tbody>

The sample above didnt come out very well; not sure if there is a better tool to use than Mr. Excel HTML Maker?

thanks,
Mickdelo
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
You need a different type of formula to find first and last non-zero values. Try

=IFERROR(INDEX($E$4:$M$4,MATCH(TRUE,E7:M7<>0,0)),"") for the early start and
=IFERROR(INDEX($E$4:$M$4,MATCH(TRUE,E7:M7<>0,1)),"") for the late start
and both should be entered as array formulae using CTRL-SHIFT-ENTER
Hope this helps
Keith
 
Last edited:
Upvote 0

Forum statistics

Threads
1,203,081
Messages
6,053,416
Members
444,662
Latest member
AaronPMH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top