How to make so that deduced the result from the table?

How to make so that deduced the result from the table?
the result, found the string and drop down menu column.
and output the final data

for example, when the END 37
and 4 column
hatched value 1900

https://jsfiddle.net/ywxu9uxj/2/
<script type="text/javascript">
function calc() { 
 var operations = document.getElementById("operations");

 var workers = document.getElementById("workers");

 var system = document.getElementById("system"); 

 var result = document.getElementById("operations");
 var result = document.getElementById("workers");
 var result = document.getElementById("result_system");
 var result = document.getElementById("result");

 var price_operations = 0;
 var price_workers = 0;
 var price_system = 0; 

 var price = 0; 

 price_operations += parseInt(operations.value)*2;
 price_workers += parseInt(workers.value)*3;
 price_system += parseInt(system.options[system.selectedIndex].value);

 result_operations.innerHTML = price_operations;
 result_workers.innerHTML = price_workers;
 result_system.innerHTML = price_system;

 price=price_operations + price_workers;

 result.innerHTML = price;
} 
</script>
<table>
<tbody><tr>
 <td width="100"><input type="text" id="operations" value="0" onchange="calc()"></td>
 <td width="200"><span id="result_operations">0</span></td>
</tr>
the <tr>
 <td width="100"><input type="text" id="workers" value="0" onchange="calc()"></td>
 <td width="200"><span id="result_workers">0</span></td>
</tr>
the <tr>
 <td width="250" class="td_result">TOTAL:</td>
 <td class="td_result"><span id="result">0</span></td>
</tr>
the <tr>
 <td width="100">
 <select onchange="calc()" id="system">
 <option value>Not selected</option>
 <option value="0">1</option>
 <option value="1">2</option>
 <option value="2">3</option>
 <option value="3">4</option>
 <option value="4">5</option>
</select>
</td>
 <td width="200"><span id="result_system">0</span></td>
 </tr> 
</tbody></table>
<table>
<tbody><tr>
<td></td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td>
</tr>
the <tr>
<td>0-3</td><td>100</td><td>200</td><td>300</td><td>400</td><td>500</td>
</tr>
the <tr>
<td>4-10</td><td>600</td><td>700</td><td>800</td><td>900</td><td>1000</td>
</tr>
the <tr>
<td>11-30</td><td>1100</td><td>1200</td><td>1300</td><td>1400</td><td>1500</td>
</tr>
the <tr>
<td>31-50</td><td>1600</td><td>1700</td><td>1800</td><td>1900</td><td>2000</td>
</tr>
the <tr>
<td>51-100</td><td>2100</td><td>2200</td><td>2300</td><td>2400</td><td>2500</td>
</tr>
the <tr>
<td>>100</td><td>100</td>
</tr>
</tbody></table>
July 9th 19 at 10:30
1 answer
July 9th 19 at 10:32
Solution
Using if/else statements we find the desired row.
var selected_column = 0; //selected column from the list
var row_index = 0; //the index of the row
if(value > 0 && value < 4)
{
 row_index = 1;
}elseif(value > 3 && value < 11){
 row_index = 2;
}
...

And after we find the right tr by its index, and it's already looking for the column index:

var table = document.getElementsByTagName('table'); // get the table
var rows = table[1].getElementsByTagName('tr'); //select all rows of the table(you have two, select the second(index starts with 0)) this table
var columns = rows[4].getElementsByTagName('td'); //columns to select the rows you want, then enter the index obtained after the if/else
alert(columns[4].textContent); //finally get the value, then enter the index of the selected column

Better using jQuery
Thanks, but I can not understand? could you help me https://jsfiddle.net/ywxu9uxj/2/ - Osborn commented on July 9th 19 at 10:35
: no! you are on the edge lazy! I'm above you wrote 90% , remaining 10% fill in yourself! - Pedro_Herzog commented on July 9th 19 at 10:38

Find more questions by tags HTMLJavaScript