Home > other >  Google Sheets: IFS statement wont return date
Google Sheets: IFS statement wont return date

Time:10-27

I'm currently using the following formula:

=IFS(regexmatch(A2,"Malaysia"), 
B2-dataset!B3,REGEXMATCH(A2,"Saudi Arabia"), 
B2-dataset!B7,REGEXMATCH(A2,"Taiwan"), 
B2-dataset!B11,REGEXMATCH(A2,"Russia"), 
B2-dataset!B15,REGEXMATCH(A2,"Greece"), 
B2-dataset!B19,REGEXMATCH(A2,"South Africa"), 
B2-dataset!B23,REGEXMATCH(A2,"UAE"), 
B2-dataset!B27,REGEXMATCH(A2,"Albania"), 
B2-dataset!B31,REGEXMATCH(A2,"India"), 
B2-dataset!B35,REGEXMATCH(A2,"South Korea"), 
B2-dataset!B39,REGEXMATCH(A2,"Turkey"), 
B2-dataset!B43)

The idea is that B2 (currently as =date(dd/mm/yyyy) has a deadline date. C2 (in which the formula houses) should show the date when everything should be delivered.

Currently the outcome is a number, not a date. I've tried IF statement, which delivers a date but I can only add 3 arguments. Can someone help me?

Kind regards

CodePudding user response:

if your current output is number like 40000 it's ok and it's just formatting issue. either you will format it internally or use a formula.

try:

=TEXT(IFS(regexmatch(A2,"Malaysia"), 
 B2-dataset!B3,REGEXMATCH(A2,"Saudi Arabia"), 
 B2-dataset!B7,REGEXMATCH(A2,"Taiwan"), 
 B2-dataset!B11,REGEXMATCH(A2,"Russia"), 
 B2-dataset!B15,REGEXMATCH(A2,"Greece"), 
 B2-dataset!B19,REGEXMATCH(A2,"South Africa"), 
 B2-dataset!B23,REGEXMATCH(A2,"UAE"), 
 B2-dataset!B27,REGEXMATCH(A2,"Albania"), 
 B2-dataset!B31,REGEXMATCH(A2,"India"), 
 B2-dataset!B35,REGEXMATCH(A2,"South Korea"), 
 B2-dataset!B39,REGEXMATCH(A2,"Turkey"), 
 B2-dataset!B43), "dd/mm/yyyy")
  • Related