The input is an array [Tuesday, Wednesday] but it is should be stored in one cell only.
Using this input I want to know how many days between two dates.
I found a reference but I don't know how to make it as dynamic because it only accept integer weekday.
https://www.extendoffice.com/excel/formulas/excel-count-day-of-week-between-two-dates.html
SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(start_date&":"&end_date)))=week_day))
Someone knows how to achieve this?
EDITED: input is okay in any format as long as it should inside in one cell only
within sheets you can try:
For count:
=INDEX(LAMBDA(aix,COUNTA(IFNA(FILTER(aix,REGEXMATCH(TO_TEXT(WEEKDAY(aix)),JOIN("|",MATCH(SPLIT(REGEXREPLACE(A5,"\[|\]",""),", "),TEXT(SEQUENCE(7),"DDDD"),0)))))))(SEQUENCE(DATEDIF(A2,B2,"d")+1,1,A2,1)))
For list:
=INDEX(LAMBDA(aix,IFNA(FILTER(aix,REGEXMATCH(TO_TEXT(WEEKDAY(aix)),JOIN("|",MATCH(SPLIT(REGEXREPLACE(A5,"\[|\]",""),", "),TEXT(SEQUENCE(7),"DDDD"),0))))))(SEQUENCE(DATEDIF(A2,B2,"d")+1,1,A2,1)))
use:
=SUMPRODUCT(REGEXMATCH(TEXT(SEQUENCE(DAYS(B2, B1)+1, 1, B1),
"dddd"), REGEXREPLACE(A4, ", ?", "|")))
I'm trying to get a match in a range of text in Google Sheets basically I'm using this formula:
=IF(REGEXMATCH(H2:M2, "Hi"), "Yes", "No")
But I'm getting an error that is:
You are referencing an array in a function that is not designed to take arrays as input so you need to enable them.
Try:
=ArrayFormula(IF(REGEXMATCH(H2:M2, "Hi"), "Yes", "No"))
I'm trying to do this: =IF(("Hi"=H2:L2),"Approve","No qualify") =IF(("Here"= H2:L2),"Approve","No qualify")
Assuming E1:E2 is the list of values to check against A1:C1, you can try:
=ArrayFormula(if(countif(E1:E2,A1:C1),"Approved","Not qualified"))
When I import data via IMPORTXML it is collected as follows:
Goiania
Rio Arena
Free Ticket
LINEUP
Alok
David Guetta
Steave aoki
Dupress
Re dupre
SUBSTITUTES
Vinne
Rainbow
Jow Gonzales
Ilambach
I would like to know what the formula would be like to be able to capture only the values that are between "LINEUP" and "SUBSTITUTES". Because this import the values between these two words will change constantly, both in number of filled lines and in the names of the artists, so I need something that can fit in with the changes.
I have tried to calculate the number of characters between the two words, but I was unsuccessful at separating this data. I was just mistaken.
replace A1:A14 with your IMPORTXML formula
=TRANSPOSE(SPLIT(REGEXEXTRACT(TEXTJOIN("♦", 1, A1:A14), "LINEUP(.*)SUBSTITUTE"), "♦"))
Let's say the user enters 1.234.567,89 or 1,234,567.89 or 1 234 567,89 in any excel cell one by one and in all the above cases the user should get 1234567,89 in the output cell.
Excel
Try TEXT() with a custom format:
=TEXT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,",",""),".","")," ",""),"[>=100]#\,#0;#")
Google Spreadsheets
Try using REGEXREPLACE():
=TEXT(REGEXREPLACE(TEXT(A1,"#"),"[ ,.]",""),"[>=100]#\,#0;#")
=ARRAYFORMULA(IF(LEN(A1:A),
IFERROR(REGEXREPLACE(A1:A, "\s|\.", ),
REGEXREPLACE(""&A1:A, "\s|\.", ",")), ))
I have two columns of data in "Meds" sheet...
MedContinuing AgeAtMedStop
Yes "Blank"
Yes 72.22
No "Blank"
No 72.57
"Blank" 73.85
I am writing a formula in a separate sheet to return 1 or 0 based on the following:
If MedContinuing is "Blank", do nothing
If MedContinuing is "No" and AgeAtMedStop is blank, do nothing
If MedContinuing is "Yes" and AgeAtMedStop is "Blank", return 1. If AgeAtMedStop is a number, return 0.
If MedContinuing is "No" and AgeAtMedStop is a number, return 1. Otherwise, return nothing.
I was able to write two separate functions (see below) for when MedContinuing is "Yes" or when it is "No", but I need to combine both into one formula.
When it's Yes...
=IF(INDEX(Meds!2:2,MATCH("MedContinuing",Meds!$1:$1,0))="","",
IF(INDEX(Meds!2:2,MATCH("MedContinuing",Meds!$1:$1,0))="No","",
IF(AND(INDEX(Meds!2:2,MATCH("MedContinuing",Meds!$1:$1,0))="Yes",INDEX(Meds!2:2,MATCH("AgeAtMedStop",Meds!$1:$1,0))=""),1,0)))
When it's No...
=IF(INDEX(Meds!2:2,MATCH("MedContinuing",Meds!$1:$1,0))="","",
IF(INDEX(Meds!2:2,MATCH("MedContinuing",Meds!$1:$1,0))="Yes","",
IF(AND(INDEX(Meds!2:2,MATCH("MedContinuing",Meds!$1:$1,0))="No",INDEX(Meds!2:2,MATCH("AgeAtMedStop",Meds!$1:$1,0))=""),"",
IF(AND(INDEX(Meds!2:2,MATCH("MedContinuing",Meds!$1:$1,0))="No",INDEX(Meds!2:2,MATCH("AgeAtMedStop",Meds!$1:$1,0))>0),1,0))))
EDIT: Solution
Using Peter K's logic...
=IF(INDEX(Meds!6:6,MATCH("MedContinuing",Meds!$1:$1,0))="","",
IF(AND(INDEX(Meds!6:6,MATCH("MedContinuing",Meds!$1:$1,0))="No",INDEX(Meds!6:6,MATCH("AgeAtMedStop",Meds!$1:$1,0))=""),"",
IF(AND(INDEX(Meds!6:6,MATCH("MedContinuing",Meds!$1:$1,0))="Yes",INDEX(Meds!6:6,MATCH("AgeAtMedStop",Meds!$1:$1,0))=""),1,
IF(AND(INDEX(Meds!6:6,MATCH("MedContinuing",Meds!$1:$1,0))="Yes",INDEX(Meds!6:6,MATCH("AgeAtMedStop",Meds!$1:$1,0))>0),0,
IF(AND(INDEX(Meds!6:6,MATCH("MedContinuing",Meds!$1:$1,0))="No",INDEX(Meds!6:6,MATCH("AgeAtMedStop",Meds!$1:$1,0))>0),1,"")))))
It is not entirely clear from your question why you would use INDEX and MATCH functions for such straightforward problem ?
I suggest to start with the basic nested if function :
=IF(A2="";"";IF(A2="No";IF(B2="";"";1);IF(B2="";1;0)))
You can put this function next to your two columns, and then copy to another worksheet, so the references are taken care of by Excel.
I also assume that your data is clean and correct i.e. only the 3 possible values for MedContinuing ("Yes", "No" or blank) and 2 for AgeAtMedStop (blank or a number) exist in your columns, so no IF test is needed to eliminate other possible values.
You can try this method below
I have created a helper table for the logic you require, it will help to update or extend the logic in future
Formula in cell C2 is
=INDEX($F$2:$G$4,MATCH(A2,$E$2:$E$4,0),IF(B2="Blank",1,IF(ISNUMBER(B2),2,0)))