Extract values from one table into another table

hamohd70

New Member
Joined
Sep 21, 2016
Messages
35

I have the following sample table where I enter my data on monthly basis:

DateCGPCS-2SITRA
Jan-012215724147589
Feb-012145635686830
Mar-012446748558196
Apr-012590607281151
May-012875652809891
Jun-012867599978970
Jul-012996614509150
Aug-013009655329682
Sep-012921655718937
Oct-012884887067900
Nov-012555225107276
Dec-012529535508622
Jan-02240350074229608200
Feb-02215230069525635900
Mar-02247330074151753100
Apr-02254880059871766100
May-02291530010951819200
Jun-02290100010533878200
Jul-02306970011938937800
Aug-02315060011327902800
Sep-0229955009551818900
Oct-02293860064558827600
Nov-02254570069138739000
Dec-022441800186034680300

<tbody>
</tbody>


Then I have the following table where I filled by extracting data from the first table

Year: 2001

AREAJANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC
CGP221521452446259028752867299630092921288425552529
SITRA758968308196115198918970915096828937790072768622

<tbody>
</tbody>


my request is this: I want to extract values from the first table into the second table if the conditions is met.

The conditions are: extract values from table 1 where the area matches the one on the left most column (like "CGP" or "SITRA") and the month matches the months on the top row and the year is 2001. The value will change when the year is changed.

I need to put the formulas in an excel table.

Can you please help me with this.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
A
B
C
D
E
F
G
H
I
J
K
L
M
1
DateCGPCS-2SITRA
2
1/1/2001​
2215​
72414​
7589​
3
2/1/2001​
2145​
63568​
6830​
4
3/1/2001​
2446​
74855​
8196​
5
4/1/2001​
2590​
60728​
1151​
6
5/1/2001​
2875​
65280​
9891​
7
6/1/2001​
2867​
59997​
8970​
8
7/1/2001​
2996​
61450​
9150​
9
8/1/2001​
3009​
65532​
9682​
10
9/1/2001​
2921​
65571​
8937​
11
10/1/2001​
2884​
88706​
7900​
12
11/1/2001​
2555​
22510​
7276​
13
12/1/2001​
2529​
53550​
8622​
14
1/2/2002​
2403500​
74229​
608200​
15
2/2/2002​
2152300​
69525​
635900​
16
3/2/2002​
2473300​
74151​
753100​
17
4/2/2002​
2548800​
59871​
766100​
18
5/2/2002​
2915300​
10951​
819200​
19
6/2/2002​
2901000​
10533​
878200​
20
7/2/2002​
3069700​
11938​
937800​
21
8/2/2002​
3150600​
11327​
902800​
22
9/2/2002​
2995500​
9551​
818900​
23
10/2/2002​
2938600​
64558​
827600​
24
11/2/2002​
2545700​
69138​
739000​
25
12/2/2002​
2441800​
186034​
680300​
26
27
28
29
30
Year
2001​
31
32
AREA
JAN​
FEB​
MAR​
APR​
MAY​
JUN​
JUL​
AUG​
SEP​
OCT​
NOV​
DEC​
33
CGP
2215​
2145​
2446​
2590​
2875​
2867​
2996​
3009​
2921​
2884​
2555​
2529​
34
SITRA
7589​
6830​
8196​
1151​
9891​
8970​
9150​
9682​
8937​
7900​
7276​
8622​

<tbody>
</tbody>


B33=
SUMPRODUCT(($B$1:$D$1=$A33)*(MONTH($A$2:$A$25)=MONTH(B$32&0))*(YEAR($A$2:$A$25)=$B$30)*($B$2:$D$25)) copy across and down



For year 2002 :Change B30 from 2001 to 2002

Month are text
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,352
Members
449,080
Latest member
Armadillos

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