Outputting Discrete data from continuous dataset

ahume12

New Member
Joined
Aug 30, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hi there

I am having some issues putting a formula together to extract data from a continuous data set into a discrete data set.

I have existing table data which shows temperature between two locations in miles. In this dataset, the temperature is recorded at a non uniform/continuous interval
So the data could show 23.7 degrees between 59.01 and 59.19 miles and 21.0 between 59.19 miles and 59.37 miles.

I would like to process this data into a standard dataset, which outputs the minimum temperature between two uniform mileages
So the output data would be 59.00 to 59.25 is 21 degrees, which is the minimum temperature of the above within the bound of 59.00 to 59.25.

I have tried excel "ifs" function as well as some "if" "and" combined functions, but cant get anything that approaches the correct solution.

Would appreciate any help

Thanks
A
 

Attachments

  • To Data.png
    To Data.png
    6.9 KB · Views: 9
  • From Data.png
    From Data.png
    8.3 KB · Views: 8

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Welcome to the MrExcel board!

Is there a relationship between what you described above and the two images you provided? I cannot see where 21 degrees comes from in the images.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Apologies - I have been thinking about this for quite some time and I didn't explain adequately.
My description above was just that - it was not relevant to the data I am working with. My images above were in an attempt to give some context as I couldn't get that AddIn installed.

Managed to get the AddIn installed. See below for a bit more context.

From Data -
Sample Data AH.xlsx
ABC
1From Miles DecimalTo Miles DecimalTemp
259.5760.4125.2
360.4160.6617.3
460.6660.9121.4
560.9161.1624.6
661.1661.4116.9
Data From


To Data -
Sample Data AH.xlsx
ABC
1Miles FromMiles ToMin Temp
259.0059.25???
359.2559.50???
459.5059.75???
559.7560.00???
660.0060.25???
Data To
 
Upvote 0
Looks like you are wanting to populate C2:C6 in 'Data To'?
If so, what are the expected results and how do you get them manually?
 
Upvote 0
Regarding your 'Report': Just post again with the additional information.
(After you have made a few more posts you will then have a 10 minute window after posting to edit your post. :))
 
Upvote 0
Apologies again - I posted the reply before I had finished.
The Data From is the existing data I have in the continuous format.
Sample Data AH.xlsx
ABC
1From Miles DecimalTo Miles DecimalTemp
259.5760.4125.2
360.4160.6617.3
460.6660.9121.4
560.9161.1624.6
661.1661.4116.9
Data From

The Data To is the processed data - I would like the Data To table to read as follows.
Sample Data AH.xlsx
ABC
1Miles FromMiles ToMin Temp
259.0059.25N/A
359.2559.50N/A
459.5059.7525.2
559.7560.0025.2
660.0060.2525.2
760.2560.5017.3
860.5060.7517.3
960.7561.0021.4
1061.0061.2516.9
Data To


If more than 1 temperature is found within the new range defined within the Data To table range, I would like excel to return the minimum of two values.
 
Upvote 0
Apologies again - I posted the reply before I had finished.
No problem, easy enough to do.

See if this is it. Check/edit your table name from sheet 'Data From'

ahume12.xlsm
ABC
1Miles FromMiles ToMin Temp
25959.25#N/A
359.2559.5#N/A
459.559.7525.2
559.756025.2
66060.2525.2
760.2560.517.3
860.560.7517.3
960.756121.4
106161.2516.9
Data To
Cell Formulas
RangeFormula
C2:C10C2=MIN(IFNA(VLOOKUP([@[Miles From]],Table1,3),999),VLOOKUP([@[Miles To]],Table1,3))
 
Upvote 0
Solution
No problem, easy enough to do.

See if this is it. Check/edit your table name from sheet 'Data From'

ahume12.xlsm
ABC
1Miles FromMiles ToMin Temp
25959.25#N/A
359.2559.5#N/A
459.559.7525.2
559.756025.2
66060.2525.2
760.2560.517.3
860.560.7517.3
960.756121.4
106161.2516.9
Data To
Cell Formulas
RangeFormula
C2:C10C2=MIN(IFNA(VLOOKUP([@[Miles From]],Table1,3),999),VLOOKUP([@[Miles To]],Table1,3))
This has worked! Thank you.

From reading the formula you posted, it looks like the steps are as follows (so I can understand)
1 - You are looking to vlookup miles from temp from Column 3 in table 1. If Excel cant find this, then it returns 999, an artificially high value to enable the MIN function to work.
2 - You are looking to vlookup miles to from Column 3 in table 1.
3 - The MINfunction then compares the two and returns the minimum

Usually I wound expect to see a TRUE or FALSE here after the vlookups. Are you taking advantage of VLOOKUP using the approximate match to return the next highest value?
 
Upvote 0
Glad it worked for you. :)

1- Yes & Yes
2- Yes
3- Yes

Are you taking advantage of VLOOKUP using the approximate match to return the next highest value?
No, I'm using the default final argument of True to find an approximate match but if there is no exact match it matches the next lowest value, not highest.
 
Upvote 0
Thank you very much for the quick response and the understanding in my replies.
Many thanks again
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,812
Members
449,095
Latest member
m_smith_solihull

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