title: Appscript equivalent of "Exact" function in Excel
body: <p>The function has to check the date against the current date then only go into that day's column and send mails to students whose entry for that day is Absent 'A'. I am not able to get the comparison correct so the if condition is not working. Please have a look.</p>
  <pre><code>function sendEmails(){
  SpreadsheetApp.getActiveSpreadsheet().getSheetByName(&quot;Emails&quot;).activate();
  var ss= SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var lr=ss.getLastRow();
  var lc=ss.getLastColumn();
  var templateText= SpreadsheetApp.getActiveSpreadsheet().getSheetByName(&quot;Template&quot;).getRange(1,1).getValue();
  
  const date = new Date();
  
  let day = date.getDate();
  let month = date.getMonth() + 1;
  let year = date.getFullYear();
  
  let currentDate = `${day}-${month}-${year}`;
  //Logger.log(currentDate); // &quot;17-6-2022&quot; 
  
  
  for(var j=3; j &lt;=lc ; j++){
  for(var i=2;i&lt;=lr ;i++)
  {
   // Logger.log(ss.getRange(1,j).getValues()[0]);
   if( currentDate == ss.getRange(1,j).getValues()[0])
   {
     
       Logger.log(ss.getRange(i,j).getValues());
  
       if(ss.getRange(i,j).getValues() =='A');{
  
       var currentName= ss.getRange(i,1).getValues();
       //var currentAttendance=ss.getRange(i,3).getValue();
       var currentEmail =ss.getRange(i,2).getValues();
       var subjectLine = &quot;Missed Class Alert&quot; //+ currentAttendance ;
       var messageBody =templateText.replace(&quot;{name}&quot;,currentName).replace(&quot;{title}&quot;);
  
       MailApp.sendEmail(currentEmail,subjectLine,messageBody);
       var currentEmail = ss.getRange(i,j-1).getValue();
       Logger.log(currentEmail);
     //  }
     
   }
   }
   }
   }
   }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/KqRKd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KqRKd.png" alt="This is the sample Google Sheet it refers to " /></a></p>