I want to use a wildcard in order to format certain cells - here's what I am doing:
- File names get outputted into a sheet - these file names look like FileName = String1_numberstring_String2.csv
- The numberstring is a text, like 20131019
- I want to bold/flag any of these file names that is on a weekend. I already have a table on the right of the sheet that brings out the weekend number strings that I could reference in a formula
This is the code I have been messing with: (I think using a wildcard would work best for the string1 / string 2 because it changes, but definitely open to suggestions - "K5" below references a cell that calls out a weekend numberstring
=if(A:A = *& "_" & K5 & "_" &*, 1, 0)
If the numberstring is the 8 characters immediately following the first underscore then you can extract those 8 digits with this formula
=MID(A1,FIND("_",A1)+1,8)
....so to convert to a date and check if it's a weekend you can use this formula
=WEEKDAY(TEXT(MID(A1,FIND("_",A1)+1,8),"0000-00-00"),2)>5
No weekend list required......