If then help

Closed
Report
-
 jwafa123 -
Hello,

I am trying to create a function to do the following.

If cell C2 contains an "S", then display "437" in E2
If cell C2 contains an "E", then display "423" in E2
If cell C2 has no value then E2 should have no value

Thanks

4 replies

Try this:

=IF( C2="S", 437, IF( C2="E", 423, IF(ISBLANK(C2), "", "Bad Data" )))

The "Bad Data" message is produced if the cell contains something other than an "S", "E" or is blank. This accounts for data entry errors.

Cheers!
The C column does contain other information (a 5-6 digit number with either an S or E at the end). I want the E to be blank if there is nothing in C. I am making a template worksheet that will be used to copy and paste many different sets of data all having different numbers of rows.

Thanks
=IF(RIGHT(C2,1)="S",437,IF(RIGHT(C2,1)="E",423,""))
Perfect. Thank you.