Unable to determine logic - help

JohnMense

New Member
Joined
Jan 26, 2015
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Hoping someone can help on this logic issue I am having. Usually I am able to come up with the right equation with nested IFs but for some reason this has me a bit stumped.

I am trying to make a large chart showing for a given month how many doors are considered active. Active starts once a door is first used and then ends when there is a deletion date.
The raw data (worksheet 'Data') contains a list of Unique Numbers (doors in this case) with information on the date it was first used (can be blank as it is only vald once used), and the date it was deleted (if deleted so could be also blank). I created 2 columns (A & B) where I extract the date (Year & month only) so it can be turned into a numerical value. I do this as using the extraction of just YYYY-MM was giving me issues when trying to determine if a reference date is higher or lower (3rd worksheet 'Tables')

I created pivots (2nd worksheet) so I can see all unique doors, what doors have a first use date, and what doors are deleted.
The 3rd worksheet (Tables) is where I am trying to see for a given month how many doors are active. Top row is the YYYYMM and I compare that value against the door ID and put a '1' on the month it matches first use (or keep blank).

The issue is trying to then stop the '1' from showing when a deletion date is seen, or just keep putting it.

Overall logic is to be:
- First-use: Start putting '1' when a door has a First Use date equal or greater than the reference YYYYMM, otherwise keep blank
- Deletion Date: if a door has a deletion date stop putting a '1' (put blank) as of the following month (ie: reference month in row A is > deletion date)

Anyone have an idea how to best achieve this?

I don't see where I can upload the file so have shown an image of the tables and the first part of the formula that I have figured out.

Much appreciated.
 

Attachments

  • Annotation 2020-03-09 111148.jpg
    Annotation 2020-03-09 111148.jpg
    103 KB · Views: 17
try this mod to the formula you posted:
=IF($B2="","",IF(AND(VALUE(E$1)>=VALUE($B2),OR(VALUE($C2)>=E$1,$C2="")),"1",0))

No unfortunately it always puts 1 if deletion date is lower than the target month, BUT it doesn't take into account the first use date. Also when deletion date is empty it gives an error.
 
Upvote 0
So the formula below, if in cell D2, gives the right result EXCEPT when the deletion date is blank. Any ideas?
=IF($B2="","",IF(AND(VALUE(D$1)>=VALUE($B2),VALUE($C2)>=D$1),1,0))

And hey everyone I really appreciate the ideas!
 
Upvote 0
How about

+Fluff.xlsm
ABCDEFGHI
1Door IDFirst UseDeletion200807200808200809200810200811200812
2S: 513 D: 10200808201111 11111
3S: 513 D: 11200808200811 1111 
4S: 513 D: 12200811      
5S: 513 D: 13200810200811   11 
6S: 513 D: 16201112      
Main
Cell Formulas
RangeFormula
D2:I6D2=IF($B2="","",IF(AND(D$1+0>=$B2+0,D$1+0<=MIN($C2+0,999999)),1,""))
 
Upvote 0
I think I got is using:

=IFERROR(IF($B2="","",IF(AND(VALUE(D$1)>=VALUE($B2),VALUE($C2)>=D$1),1,0)),(IF(D$1>=VALUE($B2),1,"")))
 
Upvote 0

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