Summarizing results from crosstab queries

JHSam

Board Regular
Joined
Feb 17, 2002
Messages
62
I have a crosstab query that counts the number of flags that are applied to data (e.g., counts the number of A's, B's and C's). When I try to run a simple query on the crosstab query to, say, give me a total number of A's and B's, the query does not seem to recognize the output from the crosstab query as numbers (it yields null fields). Has anyone come across something similar to this and is there a workaround?

Thanks.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
I got it figured out. You have to do two things:

First, you need to set the Field Properties|Format in the appropriate Crosstab query field to a numeric format.

Second, in the simple query summary you need to use the Nz() function to probably get the null fields treated as zero values (otherwise the summations don't work correctly).

:)
 
Upvote 0
Have you tried the Nz function you just mentioned? I've tried to use this function to accomplish the same task, but even though the zeros were in the right fields, it still treated them as Nulls and therefore wouldn't calculate. If it's working, great, if not, then try the Iif function.
 
Upvote 0
It seemed to work fine, since the calculated summation field values were correct. However, I did notice that it didn't replace the null fields with zeroes in the output of the query fields. You were using it in the format of NZ(<variable>,0) when you were working with this, correct?

Thanks for the tip on the IIF function.
 
Upvote 0

Forum statistics

Threads
1,221,539
Messages
6,160,413
Members
451,644
Latest member
hglymph

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