Google Sheet: Get Data from 3 columns?

gameover

Active Member
Joined
Jan 12, 2009
Messages
292
Dear All,

I am working on google sheet with loads of rows and columns. I have to summarize the results of main sheet into summary sheet.

Main sheet contains many columns like Name, email, phone, city 1, city 2, city 3. In summary sheet I have to give total numbers of city 1, city 2 and city 3. let me give you example here:

Row 1:

City 1: NY
City 2: NY
City 3: NY

Row 2:

City 1: DC
City 2: DC
City 3: NY

Row 3:

City 1: NY
City 2: DC
City 3: NY

Row 4:

City 1: DC
City 2: NY
City 3: DC

In summary Sheet I want following result:

Row 1 NY:

Column 1 (City 1 (total count)): 2
Column 2 (City 2 (total count)): 2
Column 3 (City 3 (total count)): 3
Column 4 (Unique Count of rows where NY is present ): 4 (As NY is present in every row and despite of it repeating in columns, it will be counted only once)

Row 2 DC:

Column 1 (City 1 (total count)): 2
Column 2 (City 2 (total count)): 2
Column 3 (City 3 (total count)): 1
Column 4 (Unique Count of rows where DC is present ): 3 (As DC is present in 3 rows)

Now in summary sheet I can easily get Column 1, 2 and 3 with the help of Pivot table but how to get column 4 is where I got lost.

Please let me know if my question is not clear or any more information is required.

Any help is appreciated.

Thanks a lot in advance for your time.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
The lay-out is not clear. What does the following from your post really mean?

Row 1:

City 1: NY
City 2: NY
City 3: NY
 
Upvote 0
The lay-out is not clear. What does the following from your post really mean?

Row 1:

City 1: NY
City 2: NY
City 3: NY

Thanks for the reply. Let me try to explain it little better.

I will try with cell numbers.

Cell A2 contains NY, B2 contains NY, C2 contains NY
Cell A3 contains DC, B3 contains DC, C3 contains NY

and so on.

I want following results in summary sheet

A1 should contain NY
B1 should have count of All NY present in mainsheet column 1
C1 should have count of all NY present in mainsheet column 2
D1 should have count of all NY present in mainsheet column 3
E1 should contain unique rows of NY in mainsheet. So even if NY is repeated in column 1 and 2 and 3, the count will show only 1 result of NY for that specific row

Please let me know if I have explained it in better form or else I will try once again.

Thanks a lot for your time.
 
Upvote 0
main (data)

Row\Col
A​
B​
C​
1​
2​
NYNYNY
3​
DCDCNY
4​
NNPTNN
5​
DCNYDC
6​

summary (processing)

Row\Col
A​
B​
C​
D​
E​
1​
2​
NY
1​
2​
2​
3​
3​
DC
2​
1​
1​
2​
4​
NN
1​
0​
1​
1​
5​
PT
0​
1​
0​
1​
6​

In B2 enter, copy across to D2, and down:

=COUNTIFS(main!A$2:A$5,$A2)

In E2 control+shift+enter, not just enter, and copy down:

=SUM(IF(MMULT((main!$A$2:$C$5=$A2)+0,TRANSPOSE(COLUMN(main!$A$2:$C$5)^0)),1))
 
Upvote 0
Hi,

I have further queries to my initial question. My Raw Main file looks like below:

Main Data:

Row/ColABCDE
1
2NYNYNYAttendingMail Sent
3DCDCNYAttendingMail Read
4NNPTNNNo InformationMail Sent
5DCNYDCNot AttendingNo Information
6
What I need is following:

Summary:

Row/ColABCDEFGHIJK
1AttendingNot AttendingNo InformationMail SentMail ReadNo Information
2NY1223210111
3DC2112110011
4NN1011001100
5PT0101001100
6
Thanks to Aladin, I have got my answer till column E. But need help in getting the count from Column F to Column K.

Please note that the Column E is always = Sum of Column F, G and H and also Column E is always = Sum of Column I, J and K

Thanks for your time and help. Please let me know if any further explanation is required.

Thanks again.
 
Last edited:
Upvote 0
The question of post #7 ... Hope this is what you require:

In F2 control+shift+enter, not just enter, copy across to H2, and down:

=SUM(IF(IF(MMULT((main!$A$2:$C$5=$A2)+0,TRANSPOSE(COLUMN(main!$A$2:$C$5)^0)),1),(main!$D$2:$D$5=F$1)+0))

In I2 control+shift+enter, not just enter, copy across to K2, and down:

=SUM(IF(IF(MMULT((main!$A$2:$C$5=$A2)+0,TRANSPOSE(COLUMN(main!$A$2:$C$5)^0)),1),(main!$E$2:$E$5=I$1)+0))
 
Upvote 0
Hi Aladin,

I don't have enough words to thank you. You are really a life saver.

Thanks a lot for your time and answering my question.

Regards.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,720
Members
448,986
Latest member
andreguerra

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