How can I count distinct values in a table and how can I convert Queries results from tables into pivot/tables in batch?

excelos

Active Member
Joined
Sep 25, 2011
Messages
366
Office Version
  1. 365
Platform
  1. Windows
Hello

How can I count the distinct values in a field in a table?

The table has been loaded as a SQL query.

If it is not possible to do that, how can I change all the queries (20 of them) into pivot/tables instead of having them as tables as I do now? Is there a way to change all of them with one click or I have to click each by each?

Thanks!
 

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

pjmorris

Well-known Member
Joined
Aug 2, 2012
Messages
1,989
Office Version
  1. 2016
Platform
  1. Windows
I would investigate Powerquery, but without more detail it is impossible to suggest (I don't know SQL).

HTH a bit
 

excelos

Active Member
Joined
Sep 25, 2011
Messages
366
Office Version
  1. 365
Platform
  1. Windows
Sorry but what do you mean exactly 'more detail'?
What more detail do you need? It would be very helpful if you let me know so that I try to provide that more detail.
I cannot guess what more detail you need. From my side, the question has all the detail needed, there isn't any more detail that I withheld.
 

sandy666

Banned - Rules violations
Joined
Oct 24, 2015
Messages
7,499
(Power Query) append/merge these 20 queries/tables into one then create Pivot from that
 

excelos

Active Member
Joined
Sep 25, 2011
Messages
366
Office Version
  1. 365
Platform
  1. Windows
(Power Query) append/merge these 20 queries/tables into one then create Pivot from that

But they are different queries, they do not result to data that can be appended/grouped into one. I need to have them as separate results in separate sheets.
 

sandy666

Banned - Rules violations
Joined
Oct 24, 2015
Messages
7,499
you've been asked about more details
but without more detail it is impossible to suggest
these are the details
But they are different queries, they do not result to data that can be appended/grouped into one. I need to have them as separate results in separate sheets.
so try create Pivot for each query directly
no pain no gain
 

Watch MrExcel Video

Forum statistics

Threads
1,127,998
Messages
5,628,043
Members
416,289
Latest member
Jbelisari

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
Top