Why is my formula getting an error?

tn312c

New Member
Joined
Oct 31, 2002
Messages
35
Hi, I have a database in SheetA and the first row is the title line. One of the columns is called STATUS and another is called TYPE. The formula I am getting an error is in another sheet.

The formula is attempting to count the number of records in the database, whose STATUS matches the value in A13 and whose TYPE is "xyz." Then the sum of the data in C1 thru C12 is subtracted from the result.

My formula is:
=DCOUNT(SheetA!$B$1:SheetA!$L$2000,STATUS,(MID(STATUS,FIND($A13,STATUS,1),LEN($A13))=$A13)=AND(LEFT(STATUS,LEN($A13))=STATUS)+AND(TYPE<>"xyz"))-SUM($C1:$C12)

My problem, I think, has to do with not knowing when to:
- Prefix function with "=" and when not to. I might have used the "=" properly in the above formula, but...
- Use the double quotes for column name in functions. My mind keeps telling me that by using the quotes, I am teling EXCEL that it is a string "STATUS", rather than indicating the column in the database, where EXCEL is to extarct the status string.

Hope you can help me with this problem too. Thank you in advance...
 
Okay, the database range is pink. The criteria range is blue. And, a 2-input table is yellow.

See the Excel Help topic for "Create a two-variable data table".
Book1
ABCDEFGHIJKL
1StatusTypeStatusType
2AAAxyz
3BBBabc
4CCCjkl
5AAAxyz14xyz
6BBBjklAAA3
7CCCabcBBB0
8AAAxyzCCC1
9BBBdef
10CCCjkl
11AAAabc
12BBBrst
13CCCrst
14AAAdef
15CCCxyz
16
Sheet1
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Okay, the database range is pink. The criteria range is blue. And, a 2-input table is yellow.

See the Excel Help topic for "Create a two-variable data table".

On the far right is a PivotTable that can be created to summarize the database.
Book1
ABCDEFGHIJKL
1StatusTypeStatusTypeCountofStatusType
2AAAxyzStatusxyz
3BBBabcAAA3
4CCCjklBBB
5AAAxyz14xyzCCC1
6BBBjklAAA3GrandTotal4
7CCCabcBBB0
8AAAxyzCCC1
9BBBdef
10CCCjkl
11AAAabc
12BBBrst
13CCCrst
14AAAdef
15CCCxyz
Sheet1
 
Upvote 0
I know there's lots of critics here for array entered formulae, but it works for me, so here is one solution: Once the formula is typed (without the {} braces) into the top/left cell of the array, press Control+Shift+ENTER. This will add the braces, and then you can copy the formula across and down as far as needed.
Hope this gets you closer to a solution.
/s/ Larry
array.xls
ABCDEFGHI
1StatusTypexyzabcjkldefrst
2AAAxyzAAA31010
3BBBabcBBB01111
4CCCjklCCC11201
5AAAxyz
6BBBjkl
7CCCabc
8AAAxyz
9BBBdef
10CCCjkl
11AAAabc
12BBBrst
13CCCrst
14AAAdef
15cccxyz
Sheet1
 
Upvote 0
Excuse the post...I got to the bottom of page one in the string and failed to notice that there was a page 2! Mark, I like your work better. /s/ Larry
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,643
Members
449,093
Latest member
Ahmad123098

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