'Comparing Range of Cells with Sample Data
The above is just a snippet of the data. Here is what I want to achieve.
- I want to fill the charge column using the sample data column. I wrote a for loop that picks each of the sample data. each of these sample data is to be compared with the first and second column which is acting as upper and lower range.
- The code is to compare the upper and lower range and print the corresponding charge. i.e for the sample data 1000, the charge should be 50 as it falls between row one and for the sample data 6000, it is to return a charge of 150 as it falls between column row 3. Is it possible to achieve this with python and openpyxl? it will be unrealistic to use nested IF as the data is very cumbersome.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

