Date Function

dleitch70

New Member
Joined
Apr 18, 2008
Messages
43
Hi All,

I'm trying to figure out the best way to do the following:

I have 12 cells (one for each month). In the first cell (January) I will have a % complete value, in the next field to the right I will have a % complete for February and so on.

I need a function that will look at current date (i.e. TODAY(), and if today is greater than January 31st, I want the function to return the value for the % complete in February. I need this to repeat; meaning if the current date is > than Feb 28, I want it to return the value from the 3rd field (% complete for March), and so on.

Something like:
=IF(TODAY()>(5/30/2015),M27,IF(TODAY()>(6/30/2015),O27, "And so on). There has to be a better why hand repeating the IF(TODAY()>xxx function over and over. Any suggestions?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi gaz_chops

Thanks for the correction. I was wondering why I couldn't get it to work. It works now...sort of. I entered it as an array, as you suggested. What I'm not sure about is the (A1). The function is as follows:

{=INDEX(L28:AH28,,MATCH(MONTH(I28),MONTH(K28:AG28),0))}

As you can see I changes the (A1) to I28, which is where I want to put the % Earned value. The problem is, it's the same cell as the function; which creates a problem.

Also, as indicated in my previous post, once it finds a value of 100%, I need it to stop, regardless of what month it is. So if the % Earned is 100% in L28 (May), that's it, I don't need it to look in June, July, etc.
 
Upvote 0
Hi gaz_chops

Thanks for the correction. I was wondering why I couldn't get it to work. It works now...sort of. I entered it as an array, as you suggested. What I'm not sure about is the (A1). The function is as follows:

{=INDEX(L28:AH28,,MATCH(MONTH(I28),MONTH(K28:AG28),0))}

As you can see I changes the (A1) to I28, which is where I want to put the % Earned value. The problem is, it's the same cell as the function; which creates a problem.

Also, as indicated in my previous post, once it finds a value of 100%, I need it to stop, regardless of what month it is. So if the % Earned is 100% in L28 (May), that's it, I don't need it to look in June, July, etc.
 
Upvote 0
Sorry A1 is where I put a date to test it, it should be today()

Also, if you add min to the formula, it will return the % but won't report above 100%

=MIN(1,INDEX(C1:Y1,,MATCH(MONTH(TODAY()),MONTH(B1:X1),0)))

Still entered as an array.
 
Upvote 0
{=MIN(1,INDEX(L28:AH28,,MATCH(MONTH(TODAY()),MONTH(K28:AG28),0)))}

Doesn't like it! It come back with an #N/A - A value is not available to the formula or function
 
Upvote 0
Strange it works fine for me! Have you got dates across the whole range K28:AG28
 
Upvote 0
Hold on, how are your months entered across K28:AG28? Are they dates or literally just the months like Jan, Feb etc?
 
Upvote 0
See if this works

=--TEXT(INDEX(C27:Y27,(MOD(MONTH(TODAY())+7,12)*2+1)),"0.00[<=1];\0[>1]")
 
Upvote 0
Or, if your months are entered as Jan, Feb etc

=MIN(1,INDEX(L28:AH28,,MATCH(TEXT(TODAY(),"mmm"),K28:AG28,0)))
No need to enter as an array

If they are entered as January etc then change the "mmm" to "mmmm"
 
Upvote 0
Hi Jason,

Unfortunately it didn't work.

It's basically like this. There are two columns (B & C). B1 says Billed C1 says % Earned. This is repeated for D1 (Billed) & E1 (% Earned), then again for F1 (Billed) & G1 (% Earned). Basically every second column is % Earned. The 1st % Earned is for May, the 2nd is for June, 3rd July and so on.

In this scenario, it might be that the % Earned for May (column C) is 10 (cell C2). Skip a column, and the next % Earned (Column E) is 20 (cell E2) and so on...

Although there may be a value (forecast) in E2, if it's the month of May, I only want to grab the value from cell C2. If that value is 100, I don't need to go any further. If the value is not 100 and the month is now June, I want to grab the value from E2. if that is 100 I don't need to go any further. If it's not 100 and we now go into July, I need it to grab he % Earned for the July Column (G2) and so on. The value grabbed will be placed in Column A - so the value grabbed (10 or 20 in the example) will be placed in cell A2. This function will then be copied for each row below (3, 4, 5....).

I hope my explanation is clear.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

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