Complex if and mid function.

B

brookdale

I have been saving the worst question for last. So here it is…Take hi
line for example:

" TBA TBA LECT TTH 01:30PM 02:50PM"

The quotes show were it starts and ends. (There is some spacing in th
beginning.) This is largely what most of my recent questions have bee
regarding. I need to create a function that will produce as a solutio
whatever you see after the LECT. It would range from 1 to 3 characters
(It is basically a day of the week: M,T,W,TH or THH, and F.)

Now here is the major problem! In this example the TTH starts in th
22nd space. There are hundreds of these, but they do not necessaril
start in the 22nd slot. Coming from the right it will always start i
the 22nd, 23rd, or 24th slot.

How can I write an equation to pull out that date section. I am s
lost


PS: I have been working on this today. Here is what I have been tryin
to do, but it is giving me one or two errors:

=MID(IF(ISBLANK(C2),K2,C2),FIND((IF(ISBLANK(C2),K2,C2)),(" * "),20),4)

In the red part I attempted to say look in the section with the text.
think that part is okay. In the middle part (here is where the troubl
is), I attempted to get the starting point of the day text, so that i
could go into the mid function. No matter what the combination, the da
(as it occurs after LECT) will always be at least 20 spaces in. If
could get this value, then I would be able to get the part in gree
(the space plus the next 3 characters, incase of THH).

Well...goodluck. I know I can't figure this out
 
B

brookdale

I might be running out today. If I don't get back to any responses
today, I will do it as soon as possible.
 
B

bj

=if(and(isblank(c2),isblank(k2)),"",your equation)
for extra spaces try the Trim() function
 
J

JE McGimpsey

I'm not entirely clear on what you're doing, but this will extract the
date section from C2:

=MID(LEFT(TRIM(C2),FIND("$",SUBSTITUTE(TRIM(C2)," ","$",4))-1),
FIND("^",SUBSTITUTE(TRIM(C2)," ","^",3))+1,255)
 
B

brookdale

Amazing bj! This is actaully embarrasing because I should have been able
to do the blank space one on my own. As for the TRIM, I have learned a
new function.

Thanks so much. I think that I am finally done with this paper. I have
been using these things today to do huge course rosters for the
college.

Thanks so much. Andrew.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top