How do you proceed with an Excel list that contains several criteria, a specific time period and a count for different years?

Thasnow

New Member
Joined
Nov 27, 2024
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I am not so familiar with this type of Excel function:

Attached you will find a test Excel.

Given are the year, package, replacement
I would like to know in the year 2025, 2026, 2027 and 2028
How many of the packages Full and No are available if they are exactly 20 years old at that time (G3).
If they are replaced, they should not be counted as part of the 2025, 2026, 2027 and 2028 package.

Thanks a lot for your help
Ben
 

Attachments

  • 2024-11-27_12-36-39.jpg
    2024-11-27_12-36-39.jpg
    59.8 KB · Views: 7
Similar to before.
Book1
CDEFGHIJKLM
1YearPackagePackagen202520262027202820292030
22006FULLFull209115201
32016No15811011
42007FULL10121101
52010FULL
62011FULL
72004FULL
82002FULL
Sheet1
Cell Formulas
RangeFormula
H2:M4H2=COUNTIFS($D$2:$D$51,IF($F2="","",$F2),$C$2:$C$51,"<="&H$1-$G2)-SUM($G2:G2)+$G2
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Dear Cubist, thanks a lot, it is similar, but difference should be by Full is only for that year example 2025 - n (20) means count all that is only given in 2005 and not before.
I tried to change in the formula "<=" to "=". As soon as I change that to the other years, I get all the data wrong due to the SUM formula.
 
Upvote 0
How about:
Book1
CDEFGHIJKLM
1YearPackagePackagen202520262027202820292030
22006FULLFull201115201
32016No15811011
42007FULL10121101
52010FULL
62011FULL
72004FULL
82002FULL
92006FULL
102018
112006FULL
122006FULL
132011FULL
142008NO
152007FULL
162007FULL
172020
182007FULL
192015NO
202008FULL
212006FULL
222003FULL
232006FULL
242012FULL
252014NO
262016NO
272017
282004NO
292015
302002NO
312007NO
322011NO
332005NO
342006FULL
352006FULL
362012NO
372006FULL
382008FULL
392006FULL
402004FULL
412002FULL
422005FULL
432003FULL
442007FULL
452003NO
462001FULL
472003FULL
482002NO
492016
502006NO
512006FULL
Sheet8
Cell Formulas
RangeFormula
H2:M4H2=COUNTIFS($D$2:$D$51,IF($F2="","",$F2),$C$2:$C$51,IF($F2="Full","=","<=")&H$1-$G2)+($F2<>"Full")*(-SUM($G2:G2)+$G2)
 
Upvote 0
Looks great thank you, but now getting to the next level:

Given, the years where it should counts the results (2025 to 2030) of Package Full, No and empty cell
Full is 20 years, means Year "C" 2005 + 20 years = 2025 (Full is only for that year example 2025 - n (20) means count all that is only given in 2005 and not before)
No is 15 years, means 2025 - 15 years = 2010 or below (could be 2009, 2008 etc) but all count in 2025. 2026 will be then -15 years =2011
Empty cell is 10 years, "C" 2015 + 10 years = 2025
"C" Year is given, "D" Package is given, "E" Replaced is given, "F" Replaced by is given

NEW:
Replaced, yes or no in Full, No or empty cell

Yes can be Yes ABT or YES OKB both are same Yes
No can be No MBT or No AZU both are same No
empty cell = empty cell

By Full, the "replaced" Yes or No is just for counting (example Yes = 4 / No = 5) no additional need
By No, the replaced Yes or No is different!
- No and replaced yes = the year on F +n (15), example C23 = 2012 + n15 = count +1 in cell 2027
- No and replaced no = the year on C +n (15), example C23 = 2015 + n15 = count +1 in cell 2030
Empty cell just count in the empty cell

Hope you can follow my thoughts otherwise let me know.


Test.xlsx
CDEFGHIJKLMNOPQR
5YearPackageReplacedReplaced byPackagenReplaced20252026202720282029203020312032
62006FULLYes ABT2020Full20Yes
72016Full20No
82007FULLYes ABT2021No15Yes
92010FULLYes ABT2021No15No
102011FULLNo AZUnot yet10Yes
112004FULLNo MBTnot yet10No
122002FULLNo MBTnot yet
132006FULLYes OKB2014
142018
152006FULLNo AZUnot yet
162006FULLNo AZUnot yet
172011FULLYes OKB2021
182015NONo MBTnot yet
192007FULLNo AZUnot yet
202007FULLYes OKB2022
212020
222007FULLNo MBTnot yet
232014NOYes ABT2012
242008FULLNo MBTnot yet
252006FULLNo AZUnot yet
262003FULLYes ABT2020
272006FULLYes ABT2021
282012FULLYes OKB2021
292014NOYes OKB2024
302016NOYes OKB2023
312017
322014NONo MBTnot yet
332015
342011NONo AZUnot yet
352007NONo MBTnot yet
362011NONo MBTnot yet
372005NOYes ABT2023
382006FULLYes ABT2020
392006FULLYes OKB2021
402012NONo AZUnot yet
412006FULLNo MBTnot yet
422008FULLNo AZUnot yet
432006FULLYes OKB2020
442004FULLNo AZUnot yet
452002FULLNo MBTnot yet
462005FULLYes ABT2021
472003FULLNo AZUnot yet
482007FULLNo MBTnot yet
492003NONo MBTnot yet
502001FULLYes ABT2010
512003FULLNo AZUnot yet
522002NOYes ABT2020
532016
542006NONo AZUnot yet
552006FULLYes OKB2014
Test 4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E6:F55Expression=FE6=0textNO
D6:D55Expression=EP6=0textNO
C6:C55Expression=FC6=0textNO
 
Upvote 0
Please present the problem in its entirety. It's not productive to introduce new piece of information every time I gave you a solution.
 
Upvote 0
I agree and I didn't get all the information likewise. This is the last version with all the criteria that are given. Thanks anyway :-)
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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