@if formula

Solved/Closed
junebug65 Posts 2 Registration date Wednesday October 7, 2015 Status Member Last seen October 8, 2015 - Oct 7, 2015 at 08:16 PM
BrianGreen Posts 1010 Registration date Saturday January 17, 2015 Status Moderator Last seen September 30, 2021 - Oct 8, 2015 at 05:02 PM
Hello,

how do i formulate the following:-
if cell B12 contains the word Meals, then I want to use the formula F12/2 else take 100% in F12

1 reply

BrianGreen Posts 1010 Registration date Saturday January 17, 2015 Status Moderator Last seen September 30, 2021 148
Oct 7, 2015 at 08:53 PM
Hi junebugs65,

Try this ...

=IF(B12="meals",F12/2,F12)

Paste this into any cell except B12 or F12 and it should work in the cell its pasted into.

I really appreciate thank you messages as a payment for solving issues :o)
0
Hi Brian

Thank you for getting back to me so quickly. It only works if it finds the exact word "meals'. Sometimes the cell can contain a different string like "staff meals' or "hotel and meals". How would I deal with that?
0
BrianGreen Posts 1010 Registration date Saturday January 17, 2015 Status Moderator Last seen September 30, 2021 148
Oct 7, 2015 at 10:08 PM
Hi Junebugs65,

Try this instead.

=IF(ISNUMBER(SEARCH("meals",B12)),F12/2,F12)


Hope this works for you. - let us know :^)
0
junebug65 Posts 2 Registration date Wednesday October 7, 2015 Status Member Last seen October 8, 2015 > BrianGreen Posts 1010 Registration date Saturday January 17, 2015 Status Moderator Last seen September 30, 2021
Oct 8, 2015 at 02:52 PM
Hi Brian

YES! it works. I didn't quite know how to use the ISNUMBER function, tried to Google but couldn't find what I was looking for.
Thanks Brian. I'm sure you'll hear from me again.
0
BrianGreen Posts 1010 Registration date Saturday January 17, 2015 Status Moderator Last seen September 30, 2021 148 > junebug65 Posts 2 Registration date Wednesday October 7, 2015 Status Member Last seen October 8, 2015
Oct 8, 2015 at 05:02 PM
Im glad its all sorted. Thanks for letting us know how it went. ... and anytime there is a problem dont hesitate to get in touch :^)
0