-1

I am trying to do a lookup but VLOOKUP does not seem to be the answer...maybe an INDEX and MATCH formula but I can't wrap my head around it.

Anyway, I have two tabs, one with data, and the other one will pull parts of the data from the first tab. In tab one my columns look like this (Google Sheets):

TAB 1      A           B          C       D      E
ROW 1 - PRODUCT      DATE        GARY    TOM    MARY
ROW 2 - Apples       9/1/2014    45      22     37
ROW 3 - Pears        9/1/2014    15      12     17
ROW 4 - Oranges      9/1/2014    18      27     61
ROW 5 - Figs         9/1/2014    4       2      7
ROW 6 - Apples       8/1/2014    35      21     31
ROW 7 - Pears        8/1/2014    19      7      11
ROW 8 - Oranges      8/1/2014    48      41     31
ROW 9 - Figs         8/1/2014    16      7      17

In TAB 2, I have the same Columns of Product, Date, Gary, Tom, Mary, but I would like to group their info by product and date. For example, TAB 2 would pull all data that matched Apples and display the entire row. So Tab 2 WOULD give these results:

TAB 2      A           B          C       D      E
ROW 1 - PRODUCT      DATE        GARY    TOM    MARY
ROW 2 - Apples       9/1/2014    45      22     37
ROW 3 - Apples       8/1/2014    35      21     31

I would then repeat this for Tab 3 which would pull data for Pears, tab 4 for Oranges, and so on. Of course we will be adding data to this each month so the formula in tab 2 will need to reflect new additions.

Thoughts?

pnuts
  • 58,317
  • 11
  • 87
  • 139
Chris
  • 101
  • 7
  • 22
  • Google sheets uses the same formulas – Chris Oct 03 '14 at 00:26
  • 1
    Chris, this is one of the very situations where a Sheets-specific function will be the best bet (ie won't work in Excel). Eg `=QUERY('Tab 1'!A:E,"select * where A = 'Apples'",1)`. In the event that you didn't want to use a pivot table. – AdamL Oct 03 '14 at 03:34
  • Thanks AdamL, appreciate the answer. And piss-off to whoever down voted a freaking question. Isn't this the point?? Douche. – Chris Oct 04 '14 at 00:57

3 Answers3

0

This is not going to be possible using standard Excel formulas. To accomplish what you wish I would recommend using several Pivot Tables.

Step 1

Start by selecting the data and navigating to Insert -> Pivot Table in the menu (depending on the version of Excel you are using, the Create PivotTable dialog may differ slightly).

Create a PivotTable for the data

Step 2

Select the PRODUCT column for your filter, the DATE column for your row groups, and the sums of GARY, TOM, and MARY for your values. Set the filter value to Apples (or whichever product you wish to display on this worksheet).

Build the PivotTable

Step 3

Make any desired cosmetic changes to the PivotTable, and then repeat for each worksheet.

Notes

  • The PivotTable will not update automatically. If you intend to continue to add rows to your first worksheet, I would recommend setting the Table/Range (in step 1) to something like Sheet1!$A$1:$E$1000. Then, when an edit is made you can click the Refresh button in the menu to refresh the data.

PivotTable menu

  • If you don't want to have to refresh all tables manually, you can build a macro that will do so automatically.
Brett Wolfington
  • 6,587
  • 4
  • 32
  • 51
  • Thank you, I will give this a shot. I am using this data to display Google Visualizer Charts on a webpage so this should work. Thanks! – Chris Oct 03 '14 at 00:28
0

I suggest using PivotTables, as opposed to formulas. You can name the data range you use which can be large enough to accommodate future entries and create a PivotTable on each tab quite easily - select the data or named range and do Insert -> PivotTable. Then, within the PivotTable Field List, use the "Choose fields to add to report:" filters and select the specific product you want for a given tab. This would work best if there are only a few handfuls of items as managing 100's of different products or product types may become tedious.

By using a large enough range, you can add data to the set and/or range and use the "Refresh All" button under the 'Data' tab to update the workbook.

Chandoo.org provides some great resources for PivotTable use. Also, when I first started I was fond of fiveminutelessons.com. To be honest, a quick Google search should turn up some decent help topics

UserUnknown
  • 172
  • 2
  • 15
0

1) in TAB 2 go to cell A1. right click, and then click data validation.
set up the box as shown below. enter image description here

2) in cells B1:E1 put DATE GARY TOM MARY respectively
3)in cell A2 write the following formula: =filter('TAB 1'!A:E,'TAB 1'!A:A=A1)
4)choose your fruit from the dropdown box.
5)it might be worht formatting A1 with a yellow fill or something...

user3616725
  • 3,485
  • 1
  • 18
  • 27