I have a simple spreadsheet of about 240 rows with columns as follows:
Column A - name
Column B - street address
Column C - city, state, Zip
Column D - phone number
Column E - email address
Column F - "Permissions" to include data in columns A-E in a directory

Column F consists of 1 to 7 characters. The first position is always Y.
The other odd positions can be Y, N or blank. The even positions are
hyphens or blanks. Examples:

Y-Y-Y-Y means OK to include all data in columns A-E in directory
Y-N-Y-Y means OK to include cols A, D and E in directory
Y-N-Y means OK to include cols A and D in directory (If there they don't
have an email address, there are only five characters.)
Y-Y-N means okay to include cols A-C in directory
Y-Y means OK to include cols A-C; phone number and email are unknown

In column G, I'm trying to create a function based on column F that will
blank out data that's not to be published. For example, in row 1, if
column F is Y-Y-N-Y, I want the phone number in D1 to be blank. Here's
what I've entered in G1:

=IF("MID(F1,5,1)"="N",D1=" ")
=IF(MID(F1,5,1)="N",D1=" ")

In either case, the word FALSE appears in G1, and the phone number in D1
remains unchanged.

I've also tried these functions in G1:

=IF("MID(F1,5,1)"=N,D1=" ")
=IF(MID(F1,5,1=N,D1=" ")

In both these cases #NAME? appears in G1 and the phone number remains

I've also tried putting the permissions data in column A and shifting
all the other data one column to the right, hoping that the there's
something odd about the sequence that Excel follows in evaluating
functions. Same results.

Any other suggestions for me to try? Note also that if the third
character is N, I want to blank both columns B and C for that row.

Thanks for you help.