×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

If cell contains certain text then run this formula, otherwise run this formula instead

If cell contains certain text then run this formula, otherwise run this formula instead

If cell contains certain text then run this formula, otherwise run this formula instead

(OP)
Hello

G5 contains a code - could be anything but if there is a K in that code then I want, cell C19 to run a formula: value in G6 divided by 12 multiply by -1 to give a negative figure. But if there's a K in G5 then I want just G6 divided by 12.


What I have at the moment is:

=IF(G5="*K*",G6/12*1,G6/12*-1)

I've had a look round and there is ISERROR, SEARCH etc which will return True and False, but I want a math result. The asterisk for wildcard isn't working for me.

Can you tell me where I've gone wrong?

thank you for helping

____________
Pendle

RE: If cell contains certain text then run this formula, otherwise run this formula instead

I don't think you can write a formula in a cell that puts something in other cell.

You could accomplish this with a little of VBA code...

---- Andy

There is a great need for a sarcasm font.

RE: If cell contains certain text then run this formula, otherwise run this formula instead

(OP)
Okay thanks - no worries, I was just trying to save a bit of time, I can learn to look for the K and change the result appropriately!!

thank you for helping

____________
Pendle

RE: If cell contains certain text then run this formula, otherwise run this formula instead

How about using the FIND() function? Not at my PC, but...

=G6/12*IF(FIND(G5,”K”)>0,1,-1)

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: If cell contains certain text then run this formula, otherwise run this formula instead

If G5 contains "K" then this (Skip's) formula works (flipped around Blue parts):
=G6/12*IF(FIND("K", G5)>0,1,-1)
else, (no "K" in G5) the formula returns #VALUE! sad



---- Andy

There is a great need for a sarcasm font.

RE: If cell contains certain text then run this formula, otherwise run this formula instead


=G6/12*IF(IFERROR(FIND("K", G5),0)>0,1,-1)


Kind of reminds me of...

e(pi * i) + 1 = 0


Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close