Formula to add 1 for previous day

DerekWooley

New Member
Joined
May 1, 2018
Messages
34
Hello, I have a list of Machines on each Friday that I would like to flag with a number. The latest Friday should have a 2 and each Friday before that should be marked with one less than the last. My data is below.

[TABLE="width: 236"]
<colgroup><col width="90" style="width: 68pt; mso-width-source: userset; mso-width-alt: 3291;"> <col width="45" style="width: 34pt; mso-width-source: userset; mso-width-alt: 1645;"> <col width="70" style="width: 53pt; mso-width-source: userset; mso-width-alt: 2560;"> <col width="108" style="width: 81pt; mso-width-source: userset; mso-width-alt: 3949;"> <tbody>[TR]
[TD="width: 90, bgcolor: #B8CCE4"]Date[/TD]
[TD="width: 45, bgcolor: #B8CCE4"]Day[/TD]
[TD="width: 70, bgcolor: #B8CCE4"]Machine[/TD]
[TD="width: 108, bgcolor: #B8CCE4"]Friday Identifier[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]7/27/2018[/TD]
[TD="bgcolor: transparent"]Friday[/TD]
[TD="bgcolor: transparent"]Machine 1[/TD]
[TD="bgcolor: transparent"]4[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]7/27/2018[/TD]
[TD="bgcolor: transparent"]Friday[/TD]
[TD="bgcolor: transparent"]Machine 2[/TD]
[TD="bgcolor: transparent"]4[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]7/27/2018[/TD]
[TD="bgcolor: transparent"]Friday[/TD]
[TD="bgcolor: transparent"]Machine 3[/TD]
[TD="bgcolor: transparent"]4[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]7/27/2018[/TD]
[TD="bgcolor: transparent"]Friday[/TD]
[TD="bgcolor: transparent"]Machine 4[/TD]
[TD="bgcolor: transparent"]4[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]7/27/2018[/TD]
[TD="bgcolor: transparent"]Friday[/TD]
[TD="bgcolor: transparent"]Machine 5[/TD]
[TD="bgcolor: transparent"]4[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]7/27/2018[/TD]
[TD="bgcolor: transparent"]Friday[/TD]
[TD="bgcolor: transparent"]Machine 6[/TD]
[TD="bgcolor: transparent"]4[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8/3/2018[/TD]
[TD="bgcolor: transparent"]Friday[/TD]
[TD="bgcolor: transparent"]Machine 1[/TD]
[TD="bgcolor: transparent"]3[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8/3/2018[/TD]
[TD="bgcolor: transparent"]Friday[/TD]
[TD="bgcolor: transparent"]Machine 2[/TD]
[TD="bgcolor: transparent"]3[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8/3/2018[/TD]
[TD="bgcolor: transparent"]Friday[/TD]
[TD="bgcolor: transparent"]Machine 3[/TD]
[TD="bgcolor: transparent"]3[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8/10/2018[/TD]
[TD="bgcolor: transparent"]Friday[/TD]
[TD="bgcolor: transparent"]Machine 1[/TD]
[TD="bgcolor: transparent"]2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8/10/2018[/TD]
[TD="bgcolor: transparent"]Friday[/TD]
[TD="bgcolor: transparent"]Machine 2[/TD]
[TD="bgcolor: transparent"]2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8/10/2018[/TD]
[TD="bgcolor: transparent"]Friday[/TD]
[TD="bgcolor: transparent"]Machine 3[/TD]
[TD="bgcolor: transparent"]2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8/10/2018[/TD]
[TD="bgcolor: transparent"]Friday[/TD]
[TD="bgcolor: transparent"]Machine 4[/TD]
[TD="bgcolor: transparent"]2[/TD]
[/TR]
</tbody>[/TABLE]

Thank you for any help.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Formula in D2:
=IF(A2="","",(MAX(A:A)-A2)/7+2)

Copy down.


Excel 2010
ABCD
1DateDayMachineFriday Identifier
27/27/2018FridayMachine 15
37/27/2018FridayMachine 25
47/27/2018FridayMachine 35
57/27/2018FridayMachine 45
67/27/2018FridayMachine 55
77/27/2018FridayMachine 65
88/3/2018FridayMachine 14
98/3/2018FridayMachine 24
108/3/2018FridayMachine 34
118/10/2018FridayMachine 13
128/10/2018FridayMachine 23
138/10/2018FridayMachine 33
148/10/2018FridayMachine 43
158/17/2018FridayMachine 52
Sheet1
Cell Formulas
RangeFormula
D2=IF(A2="","",(MAX(A:A)-A2)/7+2)
D3=IF(A3="","",(MAX(A:A)-A3)/7+2)
D4=IF(A4="","",(MAX(A:A)-A4)/7+2)
D5=IF(A5="","",(MAX(A:A)-A5)/7+2)
D6=IF(A6="","",(MAX(A:A)-A6)/7+2)
D7=IF(A7="","",(MAX(A:A)-A7)/7+2)
D8=IF(A8="","",(MAX(A:A)-A8)/7+2)
D9=IF(A9="","",(MAX(A:A)-A9)/7+2)
D10=IF(A10="","",(MAX(A:A)-A10)/7+2)
D11=IF(A11="","",(MAX(A:A)-A11)/7+2)
D12=IF(A12="","",(MAX(A:A)-A12)/7+2)
D13=IF(A13="","",(MAX(A:A)-A13)/7+2)
D14=IF(A14="","",(MAX(A:A)-A14)/7+2)
D15=IF(A15="","",(MAX(A:A)-A15)/7+2)
 
Last edited:
Upvote 0
Thank you very much. I had other weekdays between the Fridays which caused decimals so I added a max if weekday = 6 and turned it into an array formula: =if(A2="","",max(if($G2:$G$200=1,$A$2:A200))-A2)/7+2). Row G has the IF weekday = 6 put 1.

Thank you again!
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,314
Members
452,634
Latest member
cpostell

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