# plot different datasets with same horizontal axis in 1 plot

1. ## plot different datasets with same horizontal axis in 1 plot

Hi,

My problem seems quite easy, but I am not able to solve it quickly. I am measuring two different quantities of an object, each with a different measuring device. The first device is continualy measuring and producing an average value every 30 seconds. The second device is measuring every four seconds for a minute. After that this device has te recalibrate itself and is unable to measure the next minute. After that periode it start again with measurements every four seconds.

I do have two different datasets with an equal horizontal axis (time) but different values. Both quantities of the object (its behaviour in time) have to be plotted in 1 plot.

Is it possible to do this in an easy way instead of manually introducing a lot of blank cells to line up the different arrays?

2. ## Re: plot different datasets with same horizontal axis in 1 plot

It looks like it should be simple lookup function(s).

M4 =VLOOKUP(\$L4,\$H\$3:\$I\$38,2,FALSE)
N4 =VLOOKUP(\$L4,\$A\$3:\$E\$19,2,FALSE)
O4 =VLOOKUP(\$L4,\$A\$3:\$E\$19,3,FALSE)
P4 =VLOOKUP(\$L4,\$A\$3:\$E\$19,4,FALSE)
Q4 =VLOOKUP(\$L4,\$A\$3:\$E\$19,5,FALSE)

This will return N/A where the entries don't exist in a given table, and the corresponding value where it does. Before deciding what to do with the N/A error, read this (https://peltiertech.com/mind-the-gap...g-empty-cells/ ) on the way to deciding what to do with the error values.

If you have access to the XLOOKUP() function, you may look into that, as MSFT claims that XLOOKUP() is faster for these exact match lookups. You might also consider using the approximate match binary search option (4th argument of VLOOKUP() is TRUE) as that is faster. You might also consider an INDEX() and MATCH() combination that allows you to perform the slow lookup step once per row, that will further improve performance.

3. ## Re: plot different datasets with same horizontal axis in 1 plot

Thanks a lot,

It does the trick. I tried VLOOKUP, but made a mistake as I see now.

There are currently 1 users browsing this thread. (0 members and 1 guests)