Why formula isn't working?

  • Thread starter Thread starter drose
  • Start date Start date
D

drose

The error i'm getting is (A vlaue used in the formula is the wrong data type.

{=MAX(IF(MONTH(D2:D232)=MONTH(TODAY())-1,H2:H232))}

d2:d232 is either blank or month ex. January
h2:h232 is either blank or a whole number ex.2, 5, 8, 12
Thanks,
Paul
 
What exactly do you have in D2:D232? In order to use the MONTH
function, those values must be actual dates, not month names or
numbers. An element like MONTH("March") will fail because "March" is
not a date.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
The items in D2 thru D232 need to be Dates for the formula to work.
 
Using your original set up (where you only had the month name, as text, in
column D), try this array-entered formula...

=MAX(IF(D2:D232=TEXT(MONTH(TODAY()-DAY(TODAY())),"mmmm"),H2:H232))

**Commit formula using Ctrl+Shift+Enter, not just Enter by itself
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top