In the attached excel file, there are two different sheet (X_val and range_val). The X_val sheet contains a series of numbers. The range_val sheet contains R1 and R2 columns which are the lower and higher numbers of a range and the third column in range _val is a X-Id of the repective range. I want a loop which will check folloing stuffs:
- Check each values in X-val to see if it is a number which lies bettwen the numbers in range_val column 1 and 2.
- if any x-val is a number lying between range_val column 1 and 2, then create a column in X-val and write the corresponding X_ID.
- if any-number is not in a required range, then just put NaN next to the X-val.
the final desired output should be a excel sheet which look like:
Note: I have a long dataset, given example is just a part of it.