Function within IF function

WalChar17

New Member
Joined
Jun 15, 2018
Messages
3
I was curious if there is any possible way to run a function within the if function such as: =IF(IS BLANK(G3),"","") but I would like to insert the function =DATEDIF($G3,$M3,"M") in place for value_if_false so if the IF is false it would calculate that formula and display accordingly
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I was curious if there is any possible way to run a function within the if function such as: =IF(IS BLANK(G3),"","") but I would like to insert the function =DATEDIF($G3,$M3,"M") in place for value_if_false so if the IF is false it would calculate that formula and display accordingly

? ... just go ahead and position the secondary formula in the value_if_false field :
=IF(ISBLANK(G3),"",DATEDIF($G3,$M3,"M"))
 
Upvote 0
The problem with that is then the cells within the DATEDIF function aren't highlighted for use, they are just a letter and number not active cell.
 
Upvote 0
IF function #NUM!

When I type =IF(ISBLANK(G9),"",DATEDIF($G9,$M9,"M")) It works but when I do =IF(ISBLANK(G10),"",DATEDIF($G10,$M10,"M")) it gives me #NUM ! And I can't figure out why...
 
Upvote 0
Re: IF function #NUM!

What values do you have in the cells?
 
Upvote 0
Re: IF function #NUM!

@WalChar17.... Try the following instead:

=IF(G10="","",DATEDIF($G10,$M10,"M"))

G10 might appear blank, but its value is actually the null string (""), just like the result of this formula.

Only use ISBLANK when you want to be sure the cell is empty (no value), distinct from merely appearing blank.

PS.... Why do you use G10 in one place, but $G10 in another?
 
Upvote 0
Re: IF function #NUM!

@WalChar17
Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread. (rule 12 here: Forum Rules).
I have merged both threads on this occasion.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,248
Members
452,623
Latest member
cliftonhandyman

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