So I have a spreadsheet where I need to output into a cell based on the contents of another cell.
Here's some example code I have to kind of explain my situation.
if ($a1 -contains "test" + X) {$g1 = ProgramID + "-t" + X} ELSE {$g1 = "ProgramID}
name, ProgramID, and X are both variables
name could be any name of program
X could be any number between 1 and 99, so I can't use nested if statements to match the numbers.
ProgramID is just a number that represents the program amd concatenating to this should be fine.
the problem I have is that $a1 could have text after testX, or testX could contain multiple double digits which means you can't use Right to get values.
Here are some examples of $a1 value formats
name-test12
name-test 49
name-test 1-final
name-test 22-f
name-test 8- final
name-final-test 13
name
name-final
If $a1 doesn't contain testx $g1 should just be ProgramID. In other words, final can always be ignored.
I'm really not knowledgeable enough with excel to figure this one out.
Thanks for any help, even if you have some direction I could explore to make this work.
Bookmarks