Using Year Month Day formula and the old blank cell chestnut

Meady16v

New Member
Joined
Jul 17, 2018
Messages
1
Hi,

I wonder if someone can help me. I need to know how over due something is based on TODAY() from say column K but, to ignore this if, column R is populated. I've got the first bit sorted ok, it's the second part that I'm having trouble with. My formula is below, I cant work in the additional cell reference:

Code:
=IFERROR(IF(DATEDIF(K2,TODAY(),"y") = 0, "", DATEDIF(K2,TODAY(),"y") &" year(s), ")& IF(DATEDIF(K2,TODAY(),"ym") = 0, "", DATEDIF(K2,TODAY(),"ym") &" month(s), ")& IF(DATEDIF(K2,TODAY(),"md") = 0,"",DATEDIF(K2,TODAY(),"md")&" Days"),"")

Also, is there a way of tidying this up or shortening it?

The old blank cell chestnut:
I have the blank cell = 0 issue. Some of my calculations this works and if the referenced cell is blank, the cell with the formula in returns blank. However, I use the same calculation referencing different cells and I get the 0 even though I'm telling it not to. Below is my formula;

Code:
=IF(ISTEXT(G19),INDEX('Property List'!X:X,MATCH('Reports Current Programme'!G19,'Property List'!B:B,0)),"")

column X is populated with eitther "yes" "No" or no data, the no data cells are return 0 and not being left blank.

Any help would be much appreciated.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
For the first formula you could check against column R with the following (I'm afraid I haven't been able to shorten it):

=IFERROR(IF(DATEDIF(K2,TODAY(),"y")=0,"",IF(COUNTA($R:$R)=0,(DATEDIF(K2,TODAY(),"y")&" year(s), ")&IF(DATEDIF(K2,TODAY(),"ym")=0,"",DATEDIF(K2,TODAY(),"ym")&" month(s), ")&IF(DATEDIF(K2,TODAY(),"md")=0,"",DATEDIF(K2,TODAY(),"md")&" Days"),"")),"")


There are various ways around the blank cell = 0 problem:

1. Use conditional formatting to make the font colour same as background.
2. Untick the "Show a zero in cells that have zero value" box in File/Options/Advanced
3. Use another IF statement around INDEX to produce "" if the INDEX value is zero
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

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