Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Why formula isn't working?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Why formula isn't working?

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)

On Thu, 5 Feb 2009 09:29:21 -0800, drose
wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Why formula isn't working?

The items in D2 thru D232 need to be Dates for the formula to work.
--
Gary''s Student - gsnu200832


"drose" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Why formula isn't working?

I tried it with 1/1/2009 and still doesn't work. Any ideas?

"drose" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Why formula isn't working?

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

--
Rick (MVP - Excel)


"drose" wrote in message
...
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A formula not working as the result of a previous formula? Ed[_7_] Excel Discussion (Misc queries) 5 July 21st 09 06:22 PM
Formula not working Bernie R. Excel Worksheet Functions 0 May 11th 09 12:14 PM
Formula Not Working JBoyer Excel Worksheet Functions 3 July 27th 08 08:07 AM
SUM formula not working Tyson Porter Excel Discussion (Misc queries) 3 October 25th 06 10:24 PM
Formula not working Carl Hilton Excel Worksheet Functions 13 January 9th 05 06:55 PM


All times are GMT +1. The time now is 08:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"