excel - Use an array formula to check if a similar contract ended in the last 12 months -


i'm troubleshooting report spreadsheet i've written. logic had written isn't working, thought i'd see if ask here.

essentially, have list of contracts, list of products, list of end , start dates, , various other pieces of information. need know if product of renewal using information.

example data:

product   company number    start of contract        end of contract     contract id     include in month's report fax            1234             10.09.2013              10.09.2014           1                      no fax            1234             10.09.2014              10.09.2015           2                      no      box            5678             11.01.2014              30.04.2015           3                      no box            5678             01.05.2015              11.01.2016           4                     yes fax            5678             01.05.2015              01.05.2016           5                     yes cup            9876             03.05.2015              03.05.2016           6                     yes 

what want work out using data whether file new product, new business, or renewal of existing file.

the logic behind whether contract should included in month's report simple - check if start date month requested elsewhere in report.

in example given above,

  • contract id's 1,3 , 6 new business
  • id's 2 , 4 renewals
  • id 5 new product, existing business company

i've worked out basic way of working out month if there new product file, because company number won't unique, product will. i'd make better though, because if done is, return "false" first occurrence of product has subsequently been renewed.

what need find way of checking if there previous contract product listed, contracts new clients, , contracts there previous contract wasn't same product. in essence, need logic below answers please!

results:

contract id     renewal?        new product?         new business?     1              no                  no                     yes     2             yes                  no                     no     3              no                  no                     yes     4             yes                  no                     no     5              no                 yes                     no     6              no                  no                     yes 

i've got few helper columns far, "ended in last 12 months", , "number of agreements". keep getting turned around when comes logic 3 final results!

renewal - there instance of same product , company earlier start date

=countifs(a$2:a$7,a2,b$2:b$7,b2,d$2:d$7,"<"&d2)>0 

new product - there no instance of same product & company earlier start date, there instance of product & same company earlier start date

=and(countifs(a$2:a$7,a2,b$2:b$7,b2,d$2:d$7,"<"&d2)=0,countifs(a$2:a$7,"<>"&a2,b$2:b$7,b2,d$2:d$7,"<"&d2)>0) 

new business - there no instance of same company earlier start date

=countifs($b$2:$b$7,b2,$d$2:$d$7,"<"&d2)=0 

enter image description here


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -