Skip to main content
added [vba] to 25523 questions - Shog9 (Id=811)
Link
added 24 characters in body
Source Link
sifar
  • 1.2k
  • 1
  • 19
  • 51

I am pulling another workbook containing a table that has Columns like ItemCreationDate, and most columns (total 28 such columns) that begin with the word "Global" in them. i want to

I am pulling another workbook containing a table that has Columns like ItemCreationDate, and most columns that begin with the word "Global" in them. i want to

I am pulling another workbook containing a table that has Columns like ItemCreationDate, and most columns (total 28 such columns) that begin with the word "Global" in them. i want to

added 1268 characters in body
Source Link
sifar
  • 1.2k
  • 1
  • 19
  • 51

Edits for @a_horse_with_no_name :

see the screenshots of the sample file:

  1. Data sheet: this is actually a table from an input workbook that i want to pull in a Recordset. See the various "Global" column headings and their items that i want to unpivot.

enter image description here

  1. This are the 2 intermediate sheets "New" & "Old" i have to create everytime (that i want to get rid of actually). any items found in 2015 or later are put in New, whereas rest are put in Old.

enter image description here

enter image description here

  1. enter image description here

  2. JFYI, the formulae that are manually used in Output columns are :

C column (New):

=COUNTIF(INDEX(New!$A:$D,0,MATCH($A2,New!$1:$1,0)),Output!$B2)

D Column (Old):

=COUNTIF(INDEX(Old!$A:$D,0,MATCH($A2,Old!$1:$1,0)),Output!$B2)

E Column (% New):

=Output!C2/SUM(C$2:C$6)

F Column (% Old):

=Output!D2/SUM(D$2:D$6)

G Column (Index):

=IF(AND(E2<=0,F2<=0),0,IF(AND(E2>0,F2>0),E2/F2,1))

Hope this helps.

Edits for @a_horse_with_no_name :

see the screenshots of the sample file:

  1. Data sheet: this is actually a table from an input workbook that i want to pull in a Recordset. See the various "Global" column headings and their items that i want to unpivot.

enter image description here

  1. This are the 2 intermediate sheets "New" & "Old" i have to create everytime (that i want to get rid of actually). any items found in 2015 or later are put in New, whereas rest are put in Old.

enter image description here

enter image description here

  1. enter image description here

  2. JFYI, the formulae that are manually used in Output columns are :

C column (New):

=COUNTIF(INDEX(New!$A:$D,0,MATCH($A2,New!$1:$1,0)),Output!$B2)

D Column (Old):

=COUNTIF(INDEX(Old!$A:$D,0,MATCH($A2,Old!$1:$1,0)),Output!$B2)

E Column (% New):

=Output!C2/SUM(C$2:C$6)

F Column (% Old):

=Output!D2/SUM(D$2:D$6)

G Column (Index):

=IF(AND(E2<=0,F2<=0),0,IF(AND(E2>0,F2>0),E2/F2,1))

Hope this helps.

added 131 characters in body
Source Link
sifar
  • 1.2k
  • 1
  • 19
  • 51
Loading
Source Link
sifar
  • 1.2k
  • 1
  • 19
  • 51
Loading