I need help. This is beyond my skill set but I'm willing to learn.

colemanj26

New Member
Joined
Feb 13, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I am working on a new Task sheet and am unsure how to write these formulas. I need to make a Mold PM (preventative maintenance) task sheet that is based on a yearly calendar. The sheet is based on a set number of days. So, say the mold has to be PM every 30 uses after 30 uses I need the numbers to go into the negative reflecting that we missed the expected day when it has been done, I need to be able reset it back to the 30 after the PM has to been completed. I also need it to have a subtraction formula in the days of the month so that it can be subtracted from the 30 uses until the task needs to be completed again. I know this is confusing, but I have an understanding of excel but this is beyond my skill set.

1) I need the days to subtract from the total uses everyday it is used (ex. I used the mold Mon, Thursday and Sunday, so it would subtract 3 uses from the total uses of 30 leaving it at 27. Once it goes to 0 uses, I need it to go into the negative (I assume this will be conditional formatting to make it red or something like that)

2) I need the days in the month columns to automatically subtract from overall uses once I input that it was used on that day. (ex. I used it 17 times in January which means I have 13 (Based on 30-use cycle) more uses of that mold before I have to pull it out and clean/repair it)

3) Once the PM is completed, I need to be able to reset the counter, but I need to be able to reset the counter on the day it was put back into production. (If it is taken out of production on Feb 16 and was returned to the shop on Feb 20. I need the file to reflect the new 30 uses starts on Feb 20)

Please help I have gotten some aspects to work but I can't link it together properly. I have tried -SUMIF, DATEDIF, TIME () conditional formatting =MAX/MIN. I have tooled around with every formula I can think of and can't get it to work. I know you may ask me to share the file but I cannot because it is a work-related project, and no one know how to help me. I just need some formula ideas that I can try to string together.

Thank you
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
how is the data laid out ? - see below , provide a sample using XL2BB or share
is it just 1 mould

do you just list the dates it was used and then a day its returned - so just a list

i may have really overcomplicated this
=IF(B2="returned",30,30-COUNTIF(INDIRECT(ADDRESS(MATCH(MAXIFS($A$2:A2,$C$2:C2,30),$A$2:A2,0)+1,2)&":"&ADDRESS(ROW(),2,4)),"used"))

Now you can use the 0 to flag it needs a PM .... using an IF statement - you could also add a colour amber when nearing to zero - say 5 uses left before PM needed

so a conditional format less than 0 for red

if not , then we need to see the layout you want or have so far

As i say - i may have overcomplicated this - and with helper columns may be a simplier formula - i'll have a look and see

Book1
ABC
1DatesStatusPM Required
21/1/23returned30
31/2/23Used29
41/3/23Used28
51/4/23Used27
61/5/23Used26
71/6/23Used25
81/7/23Used24
91/8/23Used23
101/9/23Used22
111/10/23Used21
121/11/23Used20
131/12/23returned30
141/13/23Used29
151/14/23Used28
161/15/23Used27
171/16/23Used26
181/17/23Used25
191/18/23Used24
201/19/23Used23
211/20/23Used22
221/21/23Used21
232/1/23Returned30
241/23/23Used29
251/24/23Used28
261/25/23Used27
271/26/23Used26
281/27/23Used25
291/28/23Used24
301/29/23Used23
311/30/23Used22
321/31/23Used21
332/1/23Used20
342/2/23Used19
352/3/23Used18
362/4/23Used17
372/5/23Used16
382/6/23Used15
392/7/23Used14
402/8/23Used13
412/9/23Used12
422/10/23Used11
432/11/23Used10
442/12/23Used9
452/13/23Used8
462/14/23Used7
472/15/23Used6
482/16/23Used5
492/17/23Used4
502/18/23Used3
512/19/23Used2
522/20/23Used1
532/21/23Used0
542/22/23Used-1
552/23/23Used-2
562/24/23Used-3
572/25/23Used-4
582/26/23Used-5
592/27/23Used-6
602/28/23Used-7
613/1/23Used-8
623/2/23Used-9
633/3/23Used-10
643/4/23Used-11
653/5/23Used-12
663/6/23Used-13
673/7/23Used-14
Sheet1
Cell Formulas
RangeFormula
C2:C67C2=IF(B2="returned",30,30-COUNTIF(INDIRECT(ADDRESS(MATCH(MAXIFS($A$2:A2,$C$2:C2,30),$A$2:A2,0)+1,2)&":"&ADDRESS(ROW(),2,4)),"used"))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:C67Expression=$C1<0textNO


Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed
 
Upvote 0
OK, howabout a much simpler formula
=IF(B2="returned",30,D1-1)

As i say , I really overcomplicated that .......

starts with the item returned in row 2

and added an IF
=IF(C2<0,"Pm Overdue",IF(C2<5,C2&" days to PM",""))

plus amber conditional formatting

Book1
ABCD
1DatesStatusDays to PMStatus
21/1/23returned30 
31/2/23Used29 
41/3/23Used28 
51/4/23Used27 
61/5/23Used26 
71/6/23Used25 
81/7/23Used24 
91/8/23Used23 
101/9/23Used22 
111/10/23Used21 
121/11/23Used20 
131/12/23returned30 
141/13/23Used29 
151/14/23Used28 
161/15/23Used27 
171/16/23Used26 
181/17/23Used25 
191/18/23Used24 
201/19/23Used23 
211/20/23Used22 
221/21/23Used21 
232/1/23Returned30 
241/23/23Used29 
251/24/23Used28 
261/25/23Used27 
271/26/23Used26 
281/27/23Used25 
291/28/23Used24 
301/29/23Used23 
311/30/23Used22 
321/31/23Used21 
332/1/23Used20 
342/2/23Used19 
352/3/23Used18 
362/4/23Used17 
372/5/23Used16 
382/6/23Used15 
392/7/23Used14 
402/8/23Used13 
412/9/23Used12 
422/10/23Used11 
432/11/23Used10 
442/12/23Used9 
452/13/23Used8 
462/14/23Used7 
472/15/23Used6 
482/16/23Used5 
492/17/23Used44 days to PM
502/18/23Used33 days to PM
512/19/23Used22 days to PM
522/20/23Used11 days to PM
532/21/23Used00 days to PM
542/22/23Used-1Pm Overdue
552/23/23Used-2Pm Overdue
562/24/23Used-3Pm Overdue
572/25/23Used-4Pm Overdue
582/26/23Used-5Pm Overdue
592/27/23Used-6Pm Overdue
602/28/23Used-7Pm Overdue
613/1/23Used-8Pm Overdue
623/2/23Used-9Pm Overdue
633/3/23Used-10Pm Overdue
643/4/23Used-11Pm Overdue
653/5/23Used-12Pm Overdue
663/6/23Used-13Pm Overdue
673/7/23Used-14Pm Overdue
Sheet1
Cell Formulas
RangeFormula
C2:C67C2=IF(B2="returned",30,C1-1)
D2:D67D2=IF(C2<0,"Pm Overdue",IF(C2<5,C2&" days to PM",""))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:D100Expression=$C1<0textYES
A2:D100Expression=AND($C2<>"",$C2<5)textNO
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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