# Excel/Array results

Question
When looking at an array of numbers

0 0 0 1 1 2 2 2 2 3 3 3 3 3 3 2 2 2 1 1 0 0 0 0 0

Each corresponding in a column under a time (ie in this example the array starts at 630 am and goes by 15 minute intervals to 9am then goes from 3pm to 6pm in 15 minute intervals - so at 715 and we go need 1 teacher, at 745am we need 2 teachers and at 845 we need three teachers.

I need to be able to have excel look at the full array and send me data back like:

Staffing needs
715am - 1 teacher
745am - 2 teachers
845am - 3 teachers
415pm - 2 teachers
500pm - 1 teacher
530PM - 0 teachers

can you help me??

Teachers Needed
B7 - just enter the number 1
B8:  =IF(OR(B7+1>MAX(\$2:\$2), B6>B7), B7-1,B7+1)

Copy B8 down and it will create the list of teachers needed

C7:  =INDEX(INDEX(\$1:\$1, MATCH(H7,\$2:\$2,0)):\$AZ\$1, MATCH(\$H8, INDEX(\$2:\$2, MATCH(H7,\$2:\$2,0)):\$AZ\$2, 0))

Copy C7 down and it will create the list of times teachers are needed

This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

#### Jerry Beaucaire

##### Expertise

Excel Formulas, macros, automation. Microsoft Excel MVP - 2010. Code site with free code snippets and techniques: http://sites.madrocketscientist.com/jerrybeaucaires-excelassistant/files

##### Experience

Microsoft Excel MVP - 2010. I have my own extensive Excel help/code site: http://sites.madrocketscientist.com/jerrybeaucaires-excelassistant/files ===================== I have been offering free assistance as an Excel aid on many web sites for many years: (http://www.excelforum.com - JBeaucaire) ======== (http://www.askmehelpdesk.com/spreadsheets - JBeaucaire) ======= (http://www.mrexcel.com/forum - jbeaucaire)

Education/Credentials
Bachelor's Degree from Azusa Pacific University in Mathematics and Music Composition

Awards and Honors
Microsoft Excel MVP 2010