If, Then, But also... formula :)

excelidiotSC

New Member
Joined
Dec 22, 2022
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hi. I have a simple spreadsheet for scheduling periodic PM work for 95 injection molding machines at my plant.

Brief setup:
We have two levels of PM work, based on machine cycles:
· 1,000,000 Cycles = Lvl 10 PM
· 2,000,000 Cycles = Lvl 20 PM
If we perform a 20 on a machine, then the next PM will be a 10 and vice versa.
However, in case a machine doesn't run very often, we have to perform a Lvl 20 PM at least once a year.

SO... in the below spreadsheet example, how do I write a logic-based formula that will read the value in Column H (either 10 or 20) and generate the appropriate value in Column E, given the Date entered in Column I?

PM List.jpg


I could see the following logic statements being true and possibly helpful:
· If Hx>10, then Ex=10
· But, if Ix< Today minus 365days, then Ex=20

Unfortunately, IT won't allow me to install XL2BB. :(
And, yes, I know we're rather behind on PM work... Haha

--Steve
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Does this work?
Book1.xlsx
ABCEFHIJ
1CELLMACHAUTOTHIS PMPROJ DATELAST PMLAST DATEReason
2C1AFN/A105/25/2023203/18/2022Last PM was a 20 and Last Date < 1 year
3C1AGN/A205/24/2023202/25/2021Last PM was a 20, but Last Date > 1 year
4C1AHN/A201/16/2023208/4/2021Last PM was a 20, but Last Date > 1 year
5C1AKN/A104/29/2023205/18/2022Last PM was a 20 and Last Date < 1 year
6C1GAN/A204/13/20232011/24/2020Last PM was a 20, but Last Date > 1 year
7C1GDN/A204/14/2023208/16/2021Last PM was a 20, but Last Date > 1 year
8C2AEN/A204/13/20232010/1/2021Last PM was a 20, but Last Date > 1 year
9C2CUN/A2011/30/20232011/18/2020Last PM was a 20, but Last Date > 1 year
10C2HBN/A2012/31/20222011/12/2021Last PM was a 20, but Last Date > 1 year
11C2HDROBAG 1109/12/20232011/15/2022Last PM was a 20 and Last Date < 1 year
12C2MFN/A109/19/2022203/1/2022Last PM was a 20 and Last Date < 1 year
13C3BTSP-BT207/24/20221011/24/2021Last PM was a 10
14C3BYSP-BY209/5/20222010/27/2021Last PM was a 20, but Last Date > 1 year
15C3IFRKR 37207/8/2022103/4/2022Last PM was a 10
16C3IGRKR 35203/24/20222010/10/2021Last PM was a 20, but Last Date > 1 year
17C3MJSP-MJ201/10/20232011/5/2021Last PM was a 20, but Last Date > 1 year
18C3MKN/A2010/29/2022201/12/2021Last PM was a 20, but Last Date > 1 year
Sheet1
Cell Formulas
RangeFormula
E2:E18E2=IF(OR(I2<(TODAY()-365),H2=10),20,10)
 
Upvote 0
Solution
Thanks for the quick reply! That clearly seems to work in your example, but only generates 20s in my spreadsheet.. I'll play around with it and see if I can figure out why.

--Steve
 
Upvote 0
Z51 - works perfectly! Thank you.

True to my username, I had reorganized my spreadsheet prior to using your formula, so the columns were no longer the same. Edited columns in formula and works now. Thanks so much!

--Steve
 
Upvote 0

Forum statistics

Threads
1,215,440
Messages
6,124,882
Members
449,193
Latest member
PurplePlop

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