return value based on current month

davisj80

New Member
Joined
Nov 15, 2011
Messages
3
I'd like to return values based on the current month. I tried hlookup(month(today()),$a$1:$l$3,3,false) but it didn't work because i it's looking up the number of the month which isn't in row a. How do i do this? <table border="0" cellpadding="0" cellspacing="0" width="1127"><colgroup><col style="mso-width-source:userset;mso-width-alt:4498;width:92pt" width="123"> <col style="mso-width-source:userset;mso-width-alt:3803;width:78pt" width="104"> <col style="mso-width-source:userset;mso-width-alt:2998; width:62pt" span="6" width="82"> <col style="mso-width-source:userset;mso-width-alt:4059;width:83pt" width="111"> <col style="mso-width-source:userset;mso-width-alt:3364;width:69pt" width="92"> <col style="mso-width-source:userset;mso-width-alt:3803;width:78pt" width="104"> <col style="mso-width-source:userset;mso-width-alt:3693;width:76pt" width="101"> </colgroup><tbody><tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt;width:92pt" height="20" width="123">JANUARY</td> <td class="xl66" style="width:78pt" width="104">FEBRUARY</td> <td class="xl66" style="width:62pt" width="82">MARCH</td> <td class="xl66" style="width:62pt" width="82">APRIL</td> <td class="xl66" style="width:62pt" width="82">MAY</td> <td class="xl66" style="width:62pt" width="82">JUNE</td> <td class="xl66" style="width:62pt" width="82">JULY</td> <td class="xl66" style="width:62pt" width="82">AUGUST</td> <td class="xl66" style="width:83pt" width="111">SEPTEMBER</td> <td class="xl66" style="width:69pt" width="92">OCTOBER</td> <td class="xl66" style="width:78pt" width="104">NOVEMBER</td> <td class="xl66" style="width:76pt" width="101">DECEMBER</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl67" style="height:15.75pt" height="21"> </td> <td class="xl67"> </td> <td class="xl67"> </td> <td class="xl67"> </td> <td class="xl67"> </td> <td class="xl67"> </td> <td class="xl67"> </td> <td class="xl67"> </td> <td class="xl67"> </td> <td class="xl67"> </td> <td class="xl67"> </td> <td class="xl67"> </td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl73" style="height:15.0pt" height="20"> $ 0.1857 </td> <td class="xl73"> $ 0.1866 </td> <td class="xl73"> $ 0.1871 </td> <td class="xl73"> $ 0.1920 </td> <td class="xl73"> $ 0.1925 </td> <td class="xl73"> $ 0.1927 </td> <td class="xl73"> $ 0.1969 </td> <td class="xl73"> $ 0.1975 </td> <td class="xl73"> $ 0.1984 </td> <td class="xl73"> $ 0.2030 </td> <td class="xl73"> $ 0.2034 </td> <td class="xl73"> $ 0.2043 </td> </tr> </tbody></table>
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
=TEXT(MONTH(TODAY()),"mmmm")

will always return the result January (whatever today's date). You need to take out the MONTH function, i.e.

=HLOOKUP(TEXT(TODAY(),"mmmm"),$A$1:$L$3,3,FALSE)
 
Upvote 0
I'd like to return values based on the current month. I tried hlookup(month(today()),$a$1:$l$3,3,false) but it didn't work because i it's looking up the number of the month which isn't in row a. How do i do this? <TABLE cellSpacing=0 cellPadding=0 width=1127 border=0><COLGROUP><COL style="WIDTH: 92pt; mso-width-source: userset; mso-width-alt: 4498" width=123><COL style="WIDTH: 78pt; mso-width-source: userset; mso-width-alt: 3803" width=104><COL style="WIDTH: 62pt; mso-width-source: userset; mso-width-alt: 2998" span=6 width=82><COL style="WIDTH: 83pt; mso-width-source: userset; mso-width-alt: 4059" width=111><COL style="WIDTH: 69pt; mso-width-source: userset; mso-width-alt: 3364" width=92><COL style="WIDTH: 78pt; mso-width-source: userset; mso-width-alt: 3803" width=104><COL style="WIDTH: 76pt; mso-width-source: userset; mso-width-alt: 3693" width=101></COLGROUP><TBODY><TR style="HEIGHT: 15pt" height=20><TD class=xl66 style="WIDTH: 92pt; HEIGHT: 15pt" width=123 height=20>JANUARY</TD><TD class=xl66 style="WIDTH: 78pt" width=104>FEBRUARY</TD><TD class=xl66 style="WIDTH: 62pt" width=82>MARCH</TD><TD class=xl66 style="WIDTH: 62pt" width=82>APRIL</TD><TD class=xl66 style="WIDTH: 62pt" width=82>MAY</TD><TD class=xl66 style="WIDTH: 62pt" width=82>JUNE</TD><TD class=xl66 style="WIDTH: 62pt" width=82>JULY</TD><TD class=xl66 style="WIDTH: 62pt" width=82>AUGUST</TD><TD class=xl66 style="WIDTH: 83pt" width=111>SEPTEMBER</TD><TD class=xl66 style="WIDTH: 69pt" width=92>OCTOBER</TD><TD class=xl66 style="WIDTH: 78pt" width=104>NOVEMBER</TD><TD class=xl66 style="WIDTH: 76pt" width=101>DECEMBER</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD class=xl67 style="HEIGHT: 15.75pt" height=21></TD><TD class=xl67></TD><TD class=xl67></TD><TD class=xl67></TD><TD class=xl67></TD><TD class=xl67></TD><TD class=xl67></TD><TD class=xl67></TD><TD class=xl67></TD><TD class=xl67></TD><TD class=xl67></TD><TD class=xl67></TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl73 style="HEIGHT: 15pt" height=20>$ 0.1857 </TD><TD class=xl73>$ 0.1866 </TD><TD class=xl73>$ 0.1871 </TD><TD class=xl73>$ 0.1920 </TD><TD class=xl73>$ 0.1925 </TD><TD class=xl73>$ 0.1927 </TD><TD class=xl73>$ 0.1969 </TD><TD class=xl73>$ 0.1975 </TD><TD class=xl73>$ 0.1984 </TD><TD class=xl73>$ 0.2030 </TD><TD class=xl73>$ 0.2034 </TD><TD class=xl73>$ 0.2043 </TD></TR></TBODY></TABLE>
Try it like this...

=HLOOKUP(TEXT(NOW(),"mmmm"),$A$1:$L$3,3,0)
 
Upvote 0
Hello, I'm seeking the same formula and gave this one a shot but couldn't get it to work.

I have a row of month values where January is located in C10 and December in AU10.
However, each month is part of a group of merged cells (for example January is listed merged cells C10-F10 but if you unmerge, the value shows up in C10.)

In row C46 through AU46 I have a value column that lines up under each month (again in the same number of merged cells) that I want to be returned alone, based on the current month (not summed with previous months).

1. What is the formula I would use for this.
2. Will the merged cells interfere?

Thanks!
 
Last edited:
Upvote 0
Hello, I'm seeking the same formula and gave this one a shot but couldn't get it to work.

I have a row of month values where January is located in C10 and December in AU10.
However, each month is part of a group of merged cells (for example January is listed merged cells C10-F10 but if you unmerge, the value shows up in C10.)

In row C46 through AU46 I have a value column that lines up under each month (again in the same number of merged cells) that I want to be returned alone, based on the current month (not summed with previous months).

1. What is the formula I would use for this.
2. Will the merged cells interfere?

Thanks!
Try something like this...

=INDEX(C46:AU46,MATCH(TEXT(NOW(),"mmmm"),C10:AU10,0))
 
Upvote 0

Forum statistics

Threads
1,224,153
Messages
6,176,728
Members
452,740
Latest member
MrCY

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