Share via

Multiplying data between query tables with missing values/different sizes

Anonymous
2013-05-21T02:09:37+00:00

Working in Excel 2010 with PI ProcessBook Datalink.

I'm trying to multiply numbers between two query tables in Microsoft Excel.  The tables are sorted by date, one set of values for each day.  I'm trying to put the table information into arrays using VBA to perform further calculations.  The tables at the bottom shows an example of the data.   The first table contains a full list of data over an 8 day period.  The second table has a missing value for 4/6.  These queries come locked as is in rows and I am unable to put in dummy rows with empty values.  I want to be able to multiply the values 4/1 by 4/1 etc. and be able to fill a one dimensional array in VBA with 8 values using a 0 to fill in for the element corresponding to 4/6.

4/1/2013 5
4/2/2013 12
4/3/2013 11
4/4/2013 6
4/5/2013 7
4/6/2013 30
4/7/2013 21
4/8/2013 2
4/1/2013 3
4/2/2013 8
4/3/2013 9
4/4/2013 10
4/5/2013 1
4/7/2013 14
4/8/2013 12
Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2013-05-21T12:05:31+00:00

    One way would be to create a separate 2-column range which contains the 8 dates in column 1, an

    =IFERROR(VLOOKUP(A2,FirstQueryTable,2,False),0)*IFERROR(VLOOKUP(A2,SecondQueryTable,2,False),0)

    in column 2.

    Then you can load your array from the second column of this range.

    Was this answer helpful?

    0 comments No comments