Multiple if statements based on dates

StillUnderstanding

Board Regular
Joined
Jan 30, 2021
Messages
80
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hello,

I wonder if someone might be able to helps me with an IF statement. I am looking to do the following:-

If the time between 2 dates is less than 14 then return the word "Yes", If the time between 2 dates is more than 14.01 then return the word "No", If the time is less than 14 from today then return "Not Included"

Having some issues trying to work this out and hope someone might be able to help?
 
Thanks for that

Try

Excel Formula:
=IF(ISNUMBER(MATCH(AN2,Sheet2!AM:AM,0)),IF(SUM(TODAY()-Sheet2!A4)<14,"Under 14 Days from Today",IF(SUM(B4-Sheet2!A4)>14,"More than 14 Days",IF(SUM(B4-Sheet2!A4)<14,"less than 14 days from column A in sheet 2"))),"Email Not Found in Sheet2")
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Sorry ignore that and Try

Excel Formula:
=IFNA(IF(SUM(TODAY()-INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!AM:AM,0)))<14,"Under 14 Days from Today",IF(SUM(B4-INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!AM:AM,0)))>14,"More than 14 Days",IF(SUM(B4-INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!AM:AM,0)))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2")
 
Upvote 0
Sorry ignore that and Try

Excel Formula:
=IFNA(IF(SUM(TODAY()-INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!AM:AM,0)))<14,"Under 14 Days from Today",IF(SUM(B4-INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!AM:AM,0)))>14,"More than 14 Days",IF(SUM(B4-INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!AM:AM,0)))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2")
Thanks @Sufiyan97 this works!

One last question please.

If Sheet 2 has a blank cell or #N/A in the cell (Line 9 for example) like the below:-

1656531561019.png



Then in Sheet 1 how would I get the code to return the words "No Date" (Line 4 for example)
1656531613568.png


Thanks again for your help with this, I really appreciate it.
 
Upvote 0
Try

Excel Formula:
=IF(OR(ISERROR(INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!$AM$1:$AM$500,0))),ISBLANK(INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!$AM$1:$AM$500,0)))),"No Date",IFNA(IF(SUM(TODAY()-INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!$AM$1:$AM$500,0)))<14,"Under 14 Days from Today",IF(SUM(B4-INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!$AM$1:$AM$500,0)))>14,"More than 14 Days",IF(SUM(B4-INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!$AM$1:$AM$500,0)))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2"))
 
Upvote 0
Yes this is great! Thank you so much!

I have encountered an slight issue with the code when it comes to having the same email listed on the sheet twice.

In the below from Sheet 2 highlighting the issue in green:-
1656592271494.png


How can I get the formula to match the email in "AM" and then check column "B" and if it has the words "Delayed" or "Left" in the cell, if they do appear then they would ignore that match and keep searching until it finds a match with words its told not to ignore?

Try

Excel Formula:
=IF(OR(ISERROR(INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!$AM$1:$AM$500,0))),ISBLANK(INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!$AM$1:$AM$500,0)))),"No Date",IFNA(IF(SUM(TODAY()-INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!$AM$1:$AM$500,0)))<14,"Under 14 Days from Today",IF(SUM(B4-INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!$AM$1:$AM$500,0)))>14,"More than 14 Days",IF(SUM(B4-INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!$AM$1:$AM$500,0)))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2"))[/COD
[/QUOTE]
 
Upvote 0
Try

Excel Formula:
=IF(OR(ISERROR(INDEX(Sheet2!$A$2:$A$500,AGGREGATE(15,6,(ROW(Sheet2!$AM$2:$AM$500)-ROW(Sheet2!$AM$2)+1)/(Sheet2!$AM$2:$AM$500=AP2)/(Sheet2!$B$2:$B$500<>"Delayed")/(Sheet2!$B$2:$B$500<>"left"),COUNTIF($AP$2:AP2,AP2)))),ISBLANK(INDEX(Sheet2!$A$2:$A$500,AGGREGATE(15,6,(ROW(Sheet2!$AM$2:$AM$500)-ROW(Sheet2!$AM$2)+1)/(Sheet2!$AM$2:$AM$500=AP2)/(Sheet2!$B$2:$B$500<>"Delayed")/(Sheet2!$B$2:$B$500<>"left"),COUNTIF($AP$2:AP2,AP2))))),"No Date",IFERROR(IF(SUM(TODAY()-INDEX(Sheet2!$A$2:$A$500,AGGREGATE(15,6,(ROW(Sheet2!$AM$2:$AM$500)-ROW(Sheet2!$AM$2)+1)/(Sheet2!$AM$2:$AM$500=AP2)/(Sheet2!$B$2:$B$500<>"Delayed")/(Sheet2!$B$2:$B$500<>"left"),COUNTIF($AP$2:AP2,AP2))))<14,"Under 14 Days from Today",IF(SUM(B2-INDEX(Sheet2!$A$2:$A$500,AGGREGATE(15,6,(ROW(Sheet2!$AM$2:$AM$500)-ROW(Sheet2!$AM$2)+1)/(Sheet2!$AM$2:$AM$500=AP2)/(Sheet2!$B$2:$B$500<>"Delayed")/(Sheet2!$B$2:$B$500<>"left"),COUNTIF($AP$2:AP2,AP2))))>14,"More than 14 Days",IF(SUM(B2-INDEX(Sheet2!$A$2:$A$500,AGGREGATE(15,6,(ROW(Sheet2!$AM$2:$AM$500)-ROW(Sheet2!$AM$2)+1)/(Sheet2!$AM$2:$AM$500=AP2)/(Sheet2!$B$2:$B$500<>"Delayed")/(Sheet2!$B$2:$B$500<>"left"),COUNTIF($AP$2:AP2,AP2))))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2"))
 
Upvote 0
Try

Excel Formula:
=IF(OR(ISERROR(INDEX(Sheet2!$A$2:$A$500,AGGREGATE(15,6,(ROW(Sheet2!$AM$2:$AM$500)-ROW(Sheet2!$AM$2)+1)/(Sheet2!$AM$2:$AM$500=AP2)/(Sheet2!$B$2:$B$500<>"Delayed")/(Sheet2!$B$2:$B$500<>"left"),COUNTIF($AP$2:AP2,AP2)))),ISBLANK(INDEX(Sheet2!$A$2:$A$500,AGGREGATE(15,6,(ROW(Sheet2!$AM$2:$AM$500)-ROW(Sheet2!$AM$2)+1)/(Sheet2!$AM$2:$AM$500=AP2)/(Sheet2!$B$2:$B$500<>"Delayed")/(Sheet2!$B$2:$B$500<>"left"),COUNTIF($AP$2:AP2,AP2))))),"No Date",IFERROR(IF(SUM(TODAY()-INDEX(Sheet2!$A$2:$A$500,AGGREGATE(15,6,(ROW(Sheet2!$AM$2:$AM$500)-ROW(Sheet2!$AM$2)+1)/(Sheet2!$AM$2:$AM$500=AP2)/(Sheet2!$B$2:$B$500<>"Delayed")/(Sheet2!$B$2:$B$500<>"left"),COUNTIF($AP$2:AP2,AP2))))<14,"Under 14 Days from Today",IF(SUM(B2-INDEX(Sheet2!$A$2:$A$500,AGGREGATE(15,6,(ROW(Sheet2!$AM$2:$AM$500)-ROW(Sheet2!$AM$2)+1)/(Sheet2!$AM$2:$AM$500=AP2)/(Sheet2!$B$2:$B$500<>"Delayed")/(Sheet2!$B$2:$B$500<>"left"),COUNTIF($AP$2:AP2,AP2))))>14,"More than 14 Days",IF(SUM(B2-INDEX(Sheet2!$A$2:$A$500,AGGREGATE(15,6,(ROW(Sheet2!$AM$2:$AM$500)-ROW(Sheet2!$AM$2)+1)/(Sheet2!$AM$2:$AM$500=AP2)/(Sheet2!$B$2:$B$500<>"Delayed")/(Sheet2!$B$2:$B$500<>"left"),COUNTIF($AP$2:AP2,AP2))))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2"))
Thanks for this and your amazing work, its far beyond my skill level.

It is not quite right as I think the dates it's looking at are the wrong way round.

On Sheet 2 for Date 1, this will always have a date, the variable is on Sheet 1 as it may not have a date.

Sheet 1 looks like this

1656668840052.png


Sheet 2 looks like this:-
1656668880282.png

I would be looking for the code to sit in column "D" of Sheet 1 and for it to check Sheet 2 for a matching email address and the group in "B" and then compare the date to tell me if it fits in with one of the following:-

  • Under 14 Days from Today
  • More than 14 Days
  • Less than 14 days from column A in sheet 2
  • Missing Email
  • Date 2 is earlier than date 1
It feels like its almost perfect. Are you able to help me with this please?

Thank you
 
Upvote 0
Try and let me know if it works

Index AGGREGATE.xlsx
ABCDANAO
1DateTodayIs the date less than 14 days?Email Address
211/5/20227/1/2022No Dateme3@me.com
319/05/20227/1/2022No Dateme5@me.com
418/05/20227/1/2022Under 14 Days from Todayme1@me.com
5
6
7
8
9
10
Sheet1
Cell Formulas
RangeFormula
D2:D4D2=IF(OR(ISERROR(INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!$AM$1:$AM$500,0))),ISBLANK(INDEX(Sheet2!$A$1:$A$500,MATCH(AN2,Sheet2!$AM$1:$AM$500,0)))),"No Date",IFERROR(IF(SUM(TODAY()-INDEX(Sheet2!$A$2:$A$500,AGGREGATE(15,6,(ROW(Sheet2!$AM$2:$AM$500)-ROW(Sheet2!$AM$2)+1)/(Sheet2!$AM$2:$AM$500=AN2)/(Sheet2!$B$2:$B$500<>"Delayed")/(Sheet2!$B$2:$B$500<>"left"),COUNTIF($AN$2:AN2,AN2))))<14,"Under 14 Days from Today",IF(SUM(B2-INDEX(Sheet2!$A$2:$A$500,AGGREGATE(15,6,(ROW(Sheet2!$AM$2:$AM$500)-ROW(Sheet2!$AM$2)+1)/(Sheet2!$AM$2:$AM$500=AN2)/(Sheet2!$B$2:$B$500<>"Delayed")/(Sheet2!$B$2:$B$500<>"left"),COUNTIF($AN$2:AN2,AN2))))>14,"More than 14 Days",IF(SUM(B2-INDEX(Sheet2!$A$2:$A$500,AGGREGATE(15,6,(ROW(Sheet2!$AM$2:$AM$500)-ROW(Sheet2!$AM$2)+1)/(Sheet2!$AM$2:$AM$500=AN2)/(Sheet2!$B$2:$B$500<>"Delayed")/(Sheet2!$B$2:$B$500<>"left"),COUNTIF($AN$2:AN2,AN2))))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2"))
 
Upvote 0
Thanks @Sufiyan97, this really helps.

I have added the 2 sheets together and used XL2BB as I think it might help?

Would you be able to help me overcome the below last bits? I would be very grateful.

When "Not Complete" in "C" it should say "Not Complete" in "E"
When no matching email in "Cc" it should say "Email Not Found in Sheet2" in "E"
When "Blank" in "C" it should say "No March" in "E"
If the date in "C" is earlier than the date in "AQ" then it should say "Completed before Start Date" in "E"


Data.xlsx
ABCDEAOAPAQARCCCD
1CommentData from Sheet 1Data From Sheet 2
2Date CompletedTodayEmail AddressStart DateGroupEmail Address
301/06/2022less than 14 days from column A in sheet 2me1@me.com01/06/2022Ume1@me.com
415/06/2022More than 14 Daysme2@me.com15/05/2022Dme2@me.com
5When "Not Complete" in "C" it should say "Not Complete" in "E"Not CompletedEmail not found in Sheet2me3@me.com01/06/2022Ume3@me.com
6When no matching email in "Cc" it should say "Email Not Found in Sheet2" in "E"12/06/2022No Dateme4@me.com12/06/2022Bme9@me.com
7When "Blank" in "C" it should say "No March" in "E"BlankEmail not found in Sheet2me5@me.com11/05/2022Ame5@me.com
807/07/2021Email not found in Sheet2me6@me.com01/06/2022Delayedme6@me.com
904/09/2021less than 14 days from column A in sheet 2me7@me.com04/09/2021Ame7@me.com
10If the date in "C" is earlier than the date in "AQ" then it should say "Completed before Start Date" in "E"04/04/2022less than 14 days from column A in sheet 2me8@me.com04/05/2022Ume8@me.com
11
Sheet1
Cell Formulas
RangeFormula
E3E3=IF(OR(ISERROR(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO3,Sheet1!$CC$3:$CC$502,0))),ISBLANK(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO3,Sheet1!$CC$3:$CC$502,0)))),"No Date",IFERROR(IF(SUM(TODAY()-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO3)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$3:AO3,AO3))))<14,"Under 14 Days from Today",IF(SUM(C3-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO3)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$3:AO3,AO3))))>14,"More than 14 Days",IF(SUM(C3-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO3)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$3:AO3,AO3))))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2"))
E4E4=IF(OR(ISERROR(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO4,Sheet1!$CC$3:$CC$502,0))),ISBLANK(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO4,Sheet1!$CC$3:$CC$502,0)))),"No Date",IFERROR(IF(SUM(TODAY()-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO4)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$4:AO4,AO4))))<14,"Under 14 Days from Today",IF(SUM(C4-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO4)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$4:AO4,AO4))))>14,"More than 14 Days",IF(SUM(C4-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO4)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$4:AO4,AO4))))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2"))
E5E5=IF(OR(ISERROR(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO5,Sheet1!$CC$3:$CC$502,0))),ISBLANK(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO5,Sheet1!$CC$3:$CC$502,0)))),"No Date",IFERROR(IF(SUM(TODAY()-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO5)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$5:AO5,AO5))))<14,"Under 14 Days from Today",IF(SUM(C5-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO5)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$5:AO5,AO5))))>14,"More than 14 Days",IF(SUM(C5-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO5)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$5:AO5,AO5))))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2"))
E6E6=IF(OR(ISERROR(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO6,Sheet1!$CC$3:$CC$502,0))),ISBLANK(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO6,Sheet1!$CC$3:$CC$502,0)))),"No Date",IFERROR(IF(SUM(TODAY()-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO6)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$6:AO6,AO6))))<14,"Under 14 Days from Today",IF(SUM(C6-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO6)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$6:AO6,AO6))))>14,"More than 14 Days",IF(SUM(C6-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO6)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$6:AO6,AO6))))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2"))
E7E7=IF(OR(ISERROR(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO7,Sheet1!$CC$3:$CC$502,0))),ISBLANK(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO7,Sheet1!$CC$3:$CC$502,0)))),"No Date",IFERROR(IF(SUM(TODAY()-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO7)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$7:AO7,AO7))))<14,"Under 14 Days from Today",IF(SUM(C7-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO7)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$7:AO7,AO7))))>14,"More than 14 Days",IF(SUM(C7-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO7)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$7:AO7,AO7))))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2"))
E8E8=IF(OR(ISERROR(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO8,Sheet1!$CC$3:$CC$502,0))),ISBLANK(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO8,Sheet1!$CC$3:$CC$502,0)))),"No Date",IFERROR(IF(SUM(TODAY()-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO8)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$8:AO8,AO8))))<14,"Under 14 Days from Today",IF(SUM(C8-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO8)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$8:AO8,AO8))))>14,"More than 14 Days",IF(SUM(C8-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO8)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$8:AO8,AO8))))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2"))
E9E9=IF(OR(ISERROR(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO9,Sheet1!$CC$3:$CC$502,0))),ISBLANK(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO9,Sheet1!$CC$3:$CC$502,0)))),"No Date",IFERROR(IF(SUM(TODAY()-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO9)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$9:AO9,AO9))))<14,"Under 14 Days from Today",IF(SUM(C9-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO9)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$9:AO9,AO9))))>14,"More than 14 Days",IF(SUM(C9-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO9)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$9:AO9,AO9))))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2"))
E10E10=IF(OR(ISERROR(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO10,Sheet1!$CC$3:$CC$502,0))),ISBLANK(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO10,Sheet1!$CC$3:$CC$502,0)))),"No Date",IFERROR(IF(SUM(TODAY()-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO10)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$10:AO10,AO10))))<14,"Under 14 Days from Today",IF(SUM(C10-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO10)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$10:AO10,AO10))))>14,"More than 14 Days",IF(SUM(C10-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO10)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$10:AO10,AO10))))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2"))
 
Upvote 0
Try and let me know if it works:

Book3
ABCDEAOAPAQARCCCDCECF
1CommentData from Sheet 1Data From Sheet 2
2Date CompletedTodayEmail AddressStart DateGroupEmail Address
36/1/2022less than 14 days from column A in sheet 2me1@me.com6/1/2022Ume1@me.com
46/15/2022More than 14 Daysme2@me.com5/15/2022Dme2@me.com
5When "Not Complete" in "C" it should say "Not Complete" in "E"Not CompletedNot Completedme3@me.com6/1/2022Ume3@me.com
6When no matching email in "Cc" it should say "Email Not Found in Sheet2" in "E"6/12/2022Delayed or Left or email not foundme4@me.com6/12/2022Bme9@me.com
7When "Blank" in "C" it should say "No March" in "E"BlankNo Matchme5@me.com5/11/2022Ame5@me.com
87/7/2021Delayed or Left or email not foundme6@me.com6/1/2022Delayedme6@me.com
99/4/2021less than 14 days from column A in sheet 2me7@me.com9/4/2021Ame7@me.com
10If the date in "C" is earlier than the date in "AQ" then it should say "Completed before Start Date" in "E"4/4/2022Completed Before Start Dateme8@me.com5/4/2022Ume8@me.com
11
Sheet1
Cell Formulas
RangeFormula
E3:E10E3=IF(ISERROR(INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO3)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$3:AO3,AO3)))>C3),"Delayed or Left or email not found",IF(INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO3)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$3:AO3,AO3)))>C3,"Completed Before Start Date",IF(C3="Blank","No Match",IF(C3="Not Completed","Not Completed",IF(OR(ISERROR(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO3,Sheet1!$CC$3:$CC$502,0))),ISBLANK(INDEX(Sheet1!$AQ$3:$AQ$502,MATCH(AO3,Sheet1!$CC$3:$CC$502,0)))),"No Date",IFERROR(IF(SUM(TODAY()-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO3)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$3:AO3,AO3))))<14,"Under 14 Days from Today",IF(SUM(C3-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO3)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$3:AO3,AO3))))>14,"More than 14 Days",IF(SUM(C3-INDEX(Sheet1!$AQ$3:$AQ$501,AGGREGATE(15,6,(ROW(Sheet1!$CC$3:$CC$501)-ROW(Sheet1!$CC$3)+1)/(Sheet1!$CC$3:$CC$501=AO3)/(Sheet1!$AR$3:$AR$501<>"Delayed")/(Sheet1!$AR$3:$AR$501<>"left"),COUNTIF($AO$3:AO3,AO3))))<14,"less than 14 days from column A in sheet 2"))),"Email not found in Sheet2"))))))
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,303
Members
449,078
Latest member
nonnakkong

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