Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Can I use wildcard characters in array formulas

I am using Excel 2007 and I am trying to use an array formula to search based
on two criteria: the year, and an account number. The array contains account
numbers in the format #.###.## and #.###.##.#. I want to sum only amounts
where the account number matches the first format and exclude those that
match the second format. For example, I may have account number 1.111.1,
which I would include, but account number 1.111.1.1 I would not. The array
fomula I have created,
{=SUM(IF((YEAR($B$2:$B$5294)=G$1)*($A$2:$A$5294="* .*.*"),$D$2:$D$5294,0))}
treats all results of the test for the account number as if they are false
and returns 0, even though I know that there are true results in the array.
As I have used this logic many times in the past, the only problem I could
see is the use of the wildcard characters.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Can I use wildcard characters in array formulas

I'm assuming the account numbers are TEXT entries. There may be a better way
but this works:

=SUMPRODUCT(--(LEN(A2:A10)-LEN(SUBSTITUTE(A2:A10,".",""))=2),--(YEAR(B2:B10)=G1),D2:D10)

The criteria is include entries with 2 dots.

--
Biff
Microsoft Excel MVP


"devobrown" wrote in message
...
I am using Excel 2007 and I am trying to use an array formula to search
based
on two criteria: the year, and an account number. The array contains
account
numbers in the format #.###.## and #.###.##.#. I want to sum only amounts
where the account number matches the first format and exclude those that
match the second format. For example, I may have account number 1.111.1,
which I would include, but account number 1.111.1.1 I would not. The array
fomula I have created,
{=SUM(IF((YEAR($B$2:$B$5294)=G$1)*($A$2:$A$5294="* .*.*"),$D$2:$D$5294,0))}
treats all results of the test for the account number as if they are false
and returns 0, even though I know that there are true results in the
array.
As I have used this logic many times in the past, the only problem I could
see is the use of the wildcard characters.



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
Sumproduct with wildcard characters? Dan Excel Discussion (Misc queries) 3 March 14th 07 12:36 AM
wildcard characters Hasty Excel Discussion (Misc queries) 2 July 21st 06 10:40 AM
HELP: Wildcard Characters bbddvv Excel Discussion (Misc queries) 0 June 28th 06 02:38 PM
WildCard Characters Ralph Heidecke Excel Worksheet Functions 1 June 1st 06 07:43 PM
Using wild card characters in array formulas PJB Shark Excel Worksheet Functions 3 January 19th 05 03:09 PM


All times are GMT +1. The time now is 12:03 PM.

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"