IF statement - Can it return a text and numeric response?

TAPS_MikeDion

Well-known Member
Joined
Aug 14, 2009
Messages
622
Office Version
  1. 2011
Platform
  1. MacOS
Hi all,

I was unable to find an answer to this in my search of the forum. I realize this is probably one of the easiest questions to answer on here, but can the "value_if_true" or "value_if_false" in an IF statement be set up to return both a text and numeric response?


IF(logical_expression,value_if_true, value_if_false)

For example (and I know this syntax will return a formula parse error :oops:),

=IF(H34>8,"OVERTIME = "H34-8,)

but can another formula be used to have the cell show either nothing (if false), or if true show "OVERTIME = " plus the value of a specified cell, minus 8? :confused:

Thanks,
Mike
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Try: =IF(H34>8,"OVERTIME = "&H34-8,"")
 
Upvote 0
You are very welcome. Nothing is easy until you actually know how to do it!!! :)
 
Upvote 0
LOL
Yes, that's true.

BTW, for some reason there are certain rows that (using the formula you provided) return results like this: OVERTIME = 0.24999999999998

The cells are all formatted as "0.00" so this is driving me nuts trying to figure out why it's not just displaying the 2 digits after the decimal point. Actually, can the formula you provided be set up to round up so the end result is OVERTIME = 0.25?

Thanks again,
Mike
 
Upvote 0
Try:
=IF(H34>8,"OVERTIME = "&(ROUND(H34,2)-8),"")
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,521
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top