# Help With 2 Formulas

#### Sloppyjo3

##### New Member
Good day,

Let's say each student at a school is assigned a student ID (Student #) and they can choose to eat either pizza or a hamburger each day. They submit a form requesting what they want for lunch or if they want to switch from one item to the other. I need two formulas, and I'm drawing a mental blank - I want to find out the amount of days between the "start date" and the "form received" date expressed as days (i.e. 27 days) and I also want to find out how often students are switching from pizza to hamburgers. Any help would be greatly appreciated...

 Student # Start Date End Date Form Received Lunch Choice 1​ 08/13/2012 12/31/9999 05/29/2013 Pizza 2​ 10/22/2019 01/19/2020 10/29/2019 Hamburger 3​ 04/02/2017 12/31/9999 04/07/2017 Hamburger 4​ 04/12/2020 12/31/9999 09/29/2020 Pizza 5​ 04/08/2020 07/29/2020 04/17/2020 Hamburger 5​ 07/30/2020 12/31/9999 08/07/2020 Pizza 6​ 02/20/2012 12/31/9999 05/22/2012 Pizza 7​ 04/01/2013 03/26/2014 05/09/2013 Pizza 7​ 03/27/2014 03/31/2015 04/03/2014 Hamburger 7​ 04/01/2015 12/31/9999 05/13/2015 Pizza 8​ 04/01/2016 07/24/2019 05/04/2016 Pizza

### Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

#### Dave Patton

##### Well-known Member
change the dates to your preference.
N.B. You can paste the information below to your sheet. Click on the icon below the f(x) in the header and paste to your sheet.
Please post extracts of your data with the forum's tool XL2BB so that we do not have to retype or convert the information.

T202109a.xlsm
ABCDEFG
1Student #Start DateEnd DateForm ReceivedLunch ChoiceDays # changes - Lunches
214113441423Pizza2890
324376043767Hamburger70
434282742832Hamburger50
544393344103Pizza1700
654392943938Hamburger9
754404244050Pizza81
864095941051Pizza921
974136541403Pizza38
1074172541732Hamburger7
1174209542137Pizza422
1284246142494Pizza331
3c
Cell Formulas
RangeFormula
F2:F12F2=D2-B2
G2:G12G2=IF(A2=A3,"",SUMPRODUCT(--(A\$2:A2=A1),--(1-(\$E\$2:E2=E1))))

Replies
7
Views
99
Replies
0
Views
167
Replies
5
Views
95
Replies
1
Views
113
Replies
2
Views
153

1,186,112
Messages
5,955,900
Members
438,225
Latest member
rsur

### 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.

### Which adblocker are you using?

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

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