![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
The range below is called database
Customer $$ Code AA 25 NB BB 10 NB CC 10 NB Value and Code is called Criteria Value Code 25 NB =DCOUNTA(database, "Customer", Criteria) Why did I get 3? I thought the answer is supposed to be 1? Any mistakes in my formula?? Help guys |
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 51,549
|
Well, "Value" does not exist in "Database". You have to use the same label in the criteria range as well as in the database range. Arrange your data like this:
{"Value","Code",""; 25,"NB",""; "","",""; "Customer","Value","Code"; "AA",25,"NB"; "BB",25,"NB"; "CC",10,"NB"} e.g., in A1:C7. Name A1:B2 as "Criteria", A4:C7 as Database, and use: =DCOUNTA(Database, 1, Criteria) 1 designates the Customer field, though any of [1,2,3] will do. Quote:
|
|
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
Hi, thanks, I fixed that... but the problem still persists... I want the criteria to be an AND, it seems excel interprets it as an OR. If you're interested, I'll mail you the xls file.
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 51,549
|
Quote:
aky@sem.hhs.nl |
|
|
|
|
|
|
#5 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi
I just set up a table like your uisng the COUNTA and it works fine, that is I got an answer of 1 I will email it to you if you like: davidh@ozgrid.com |
|
|
|
|
|
#6 |
|
Guest
Posts: n/a
|
Hi Dave,
Could you please.... its maslan@fiberia.com I feel really stupid today. Monday blues... Thanks. |
|
|
|
#7 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Pleasure, it's on its way.
You may also be interested in some slightly more advanced examples I have here: http://www.ozgrid.com/download/default.htm It's called: DFunctionsWithValidation.zip |
|
|
|
|
|
#8 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 51,549
|
Quote:
You had in your WB "Value" instead of "Claimable". The WB is underway to you. Aladin |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|