change cell background color - colors

http://jsfiddle.net/mannagod/Zq6w4/
now = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
cells = document.getElementById('months').getElementsByTagName('td');
for (c = 0; c < cells.length; c++) {
if (cells[c].firstChild.nodeValue == now) {
cells[c].style.backgroundColor = 'red' //today's scripture reading
cells[c].style.color = 'white'
}
}
I would like to change the background and font colors for the cell that is the current month. I tried the code above for the table below and I can't seem to make it work...
<table class="hovertable" id="hovertable" name="hovertable">
<tbody id="months">
<tr>
<td class="style2">
Jan</td>
<td class="style2">
Feb</td>
<td class="style2">
Mar</td>
<td class="style2">
Apr</td>
<td class="style2">
May</td>
<td class="style2">
Jun</td>
</tr>
<tr>
<td class="style2">
Jul</td>
<td class="style2">
Aug</td>
<td class="style2">
Sep</td>
<td class="style2">
Oct</td>
<td class="style2">
Nov</td>
<td class="style2">
Dec</td>
</tr>
</tbody>
</table>
Any ideas? Thanks.

This javascript should do what you want:
now = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
var d = new Date();
cells = document.getElementById('months').getElementsByTagName('td');
for (c = 0; c < cells.length; c++) {
if (c == d.getMonth()) {
cells[c].style.backgroundColor = 'red' //today's scripture reading
cells[c].style.color = 'white'
}
}

Related

Sort Beautiful soup elements by text value

I've search about this on the internet on how I could do this but it seems to have a different type of question & goal.
So I have this soup right here. You can have a test on this code.
from bs4 import BeautifulSoup
html = '''
<table border="1" cellspacing="0" width="300">
<tbody><tr>
<td width="50%">lesson 1</td>
<td>lesson 7</td>
</tr>
<tr>
<td width="50%">lesson 2</td>
<td>lesson 8</td>
</tr>
<tr>
<td width="50%">lesson 3</td>
<td>lesson 9</td>
</tr>
<tr>
<td width="50%">lesson 4</td>
<td>lesson 10</td>
</tr>
<tr>
<td width="50%">lesson 5</td>
<td>lesson 11</td>
</tr>
<tr>
<td width="50%">lesson 6</td>
<td>lesson 12</td>
</tr>
</tbody></table>
'''
soup = BeautifulSoup(html,"html5lib")#use any parser you want.
for td in soup.find_all("td"):
print(td)# This outputs the not sorted <td> tags
Not sorted <td> tags.
<td width="50%">lesson 1</td>
<td>lesson 7</td>
<td width="50%">lesson 2</td>
<td>lesson 8</td>
<td width="50%">lesson 3</td>
<td>lesson 9</td>
<td width="50%">lesson 4</td>
<td>lesson 10</td>
<td width="50%">lesson 5</td>
<td>lesson 11</td>
<td width="50%">lesson 6</td>
<td>lesson 12</td>
Now you can see on the .text of every <td> tag there is a text for example "lesson 1" , "lesson 7", "lesson 2" and so on... Now what I wanted to have is sort this <td> tags by its text value also by the number. So I'd want to have an output like this.
<td width="50%">lesson 1</td>
<td width="50%">lesson 2</td>
<td width="50%">lesson 3</td>
<td width="50%">lesson 4</td>
<td width="50%">lesson 5</td>
<td width="50%">lesson 6</td>
<td>lesson 7</td>
<td>lesson 8</td>
<td>lesson 9</td>
<td>lesson 10</td>
<td>lesson 11</td>
<td>lesson 12</td>
Thank you so much! I really appreciate your help.
This should do the job and give you a list of the sorted td tags that contain an a tag.
from bs4 import BeautifulSoup
html = '''
<table border="1" cellspacing="0" width="300">
<tbody><tr>
<td width="50%">lesson 1</td>
<td>lesson 7</td>
</tr>
<tr>
<td width="50%">lesson 2</td>
<td>lesson 8</td>
</tr>
<tr>
<td width="50%">lesson 3</td>
<td>lesson 9</td>
</tr>
<tr>
<td width="50%">lesson 4</td>
<td>lesson 10</td>
</tr>
<tr>
<td width="50%">lesson 5</td>
<td>lesson 11</td>
</tr>
<tr>
<td width="50%">lesson 6</td>
<td>lesson 12</td>
</tr>
</tbody></table>
'''
soup = BeautifulSoup(html, 'html.parser')
# Function takes one <td> tag, finds it's child which is an <a> tag
# it then finds the text inside it and then splits it to get the number
# this is then returned to the sorted function as an int
def sort_soup(item):
item = list(item.children)[0].text
data = item.split(" ")
return int(data[1])
out = soup.findAll('td')
out = sorted(out, key= lambda elem: sort_soup(elem))
print(out)

VBA Web-scraping - can't find/fire onchange event for date input field

I am working on a work website that has a date input field and a results table based on the date entered into that field. It also has a link to a calendar date-picker, which I don't use. When a date is entered manually, the results table changes dynamically. It changes immediately after entering the new date so I tried to find an onchange event that I could fire after changing the date field. I cannot find this event but I did find some javascript on the same page which seems to be related to the date entered into the field.
How do I automate this onchange behaviour without an onchange event in the html?
EDIT: In response to Zwenn and others wondering about the VBA I have used: I don't have any for this part of my macro because there is no onchange event for me to trigger. I have only tried changing the field value with:
iedoc.document.all.radUpToDatePicker.value = strFormattedDateValue
iedoc.document.all.radUpToDatePicker_dateInput.value = strDateVAlue
As I mentioned in the other question (which I tried to simplify by re-asking here), this works to change the values but doesn't result in a change of the underlying table as what happens when entered manually.
The HTML behind the date field:
<td>
<div id="radUpToDatePicker_wrapper" class="RadPicker RadPicker_Default" style="display:inline-block;width:160px;">
<!-- 2012.3.1016.40 --><input style="visibility:hidden;display:block;float:right;margin:0 0 -1px -1px;width:1px;height:1px;overflow:hidden;border:0;padding:0;" id="radUpToDatePicker" name="radUpToDatePicker" type="text" class="rdfd_" value="2020-06-16" title="Visually hidden input created for functionality purposes." />
<table cellspacing="0" class="rcTable rcSingle" summary="Table holding date picker control for selection of dates." style="width:100%;">
<caption style="display:none;"> RadDatePicker </caption>
<tr>
<td class="rcInputCell" style="width:100%;"><span id="radUpToDatePicker_dateInput_wrapper" class="riSingle RadInput RadInput_Default" style="display:block;width:100%;"><input id="radUpToDatePicker_dateInput" name="radUpToDatePicker$dateInput" class="riTextBox riEnabled" value="16/06/2020" type="text" /><input id="radUpToDatePicker_dateInput_ClientState" name="radUpToDatePicker_dateInput_ClientState" type="hidden" /></span></td>
<td><a title="Open the calendar popup." href="#" id="radUpToDatePicker_popupButton" class="rcCalPopup">Open the calendar popup.</a>
<div id="radUpToDatePicker_calendar_wrapper" style="display: none">
<table id="radUpToDatePicker_calendar" summary="Calendar control which enables the selection of dates." cellspacing="0" class="RadCalendar RadCalendar_Default" border="0">
<caption>
<span style='display:none;'>Calendar</span>
</caption>
<thead>
<tr>
<td class="rcTitlebar">
<table cellspacing="0" summary="Title and navigation which can change and show the current year and month." border="0">
<caption>
<span style='display:none;'>Title and navigation</span>
</caption>
<thead>
<tr>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr>
<td><a id="radUpToDatePicker_calendar_FNP" class="rcFastPrev" title="<<" href="#"><<</a></td>
<td><a id="radUpToDatePicker_calendar_NP" class="rcPrev" title="<" href="#"><</a></td>
<td id="radUpToDatePicker_calendar_Title" class="rcTitle">June 2020</td>
<td><a id="radUpToDatePicker_calendar_NN" class="rcNext" title=">" href="#">></a></td>
<td><a id="radUpToDatePicker_calendar_FNN" class="rcFastNext" title=">>" href="#">>></a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</thead>
<tbody>
<tr>
<td class="rcMain">
<table id="radUpToDatePicker_calendar_Top" class="rcMainTable" cellspacing="0" summary="Table containing all dates for the currently selected month." border="0">
<caption>
<span style='display:none;'>June 2020</span>
</caption>
<thead>
<tr class="rcWeek">
<th class="rcViewSel" scope="col"> </th>
<th id="radUpToDatePicker_calendar_Top_cs_1" title="Monday" scope="col" abbr="Mon">M</th>
<th id="radUpToDatePicker_calendar_Top_cs_2" title="Tuesday" scope="col" abbr="Tue">T</th>
<th id="radUpToDatePicker_calendar_Top_cs_3" title="Wednesday" scope="col" abbr="Wed">W</th>
<th id="radUpToDatePicker_calendar_Top_cs_4" title="Thursday" scope="col" abbr="Thu">T</th>
<th id="radUpToDatePicker_calendar_Top_cs_5" title="Friday" scope="col" abbr="Fri">F</th>
<th id="radUpToDatePicker_calendar_Top_cs_6" title="Saturday" scope="col" abbr="Sat">S</th>
<th id="radUpToDatePicker_calendar_Top_cs_7" title="Sunday" scope="col" abbr="Sun">S</th>
</tr>
</thead>
<tbody>
<tr class="rcRow">
<th id="radUpToDatePicker_calendar_Top_rs_1" scope="row">22</th>
<td class="rcOtherMonth" title="Monday, May 25, 2020">25</td>
<td class="rcOtherMonth" title="Tuesday, May 26, 2020">26</td>
<td class="rcOtherMonth" title="Wednesday, May 27, 2020">27</td>
<td class="rcOtherMonth" title="Thursday, May 28, 2020">28</td>
<td class="rcOtherMonth" title="Friday, May 29, 2020">29</td>
<td class="rcOtherMonth" title="Saturday, May 30, 2020">30</td>
<td class="rcOtherMonth" title="Sunday, May 31, 2020">31</td>
</tr>
<tr class="rcRow">
<th id="radUpToDatePicker_calendar_Top_rs_2" scope="row">23</th>
<td title="Monday, June 01, 2020">1</td>
<td title="Tuesday, June 02, 2020">2</td>
<td title="Wednesday, June 03, 2020">3</td>
<td title="Thursday, June 04, 2020">4</td>
<td title="Friday, June 05, 2020">5</td>
<td class="rcWeekend" title="Saturday, June 06, 2020">6</td>
<td class="rcWeekend" title="Sunday, June 07, 2020">7</td>
</tr>
<tr class="rcRow">
<th id="radUpToDatePicker_calendar_Top_rs_3" scope="row">24</th>
<td title="Monday, June 08, 2020">8</td>
<td title="Tuesday, June 09, 2020">9</td>
<td title="Wednesday, June 10, 2020">10</td>
<td title="Thursday, June 11, 2020">11</td>
<td title="Friday, June 12, 2020">12</td>
<td class="rcWeekend" title="Saturday, June 13, 2020">13</td>
<td class="rcWeekend" title="Sunday, June 14, 2020">14</td>
</tr>
<tr class="rcRow">
<th id="radUpToDatePicker_calendar_Top_rs_4" scope="row">25</th>
<td title="Monday, June 15, 2020">15</td>
<td title="Tuesday, June 16, 2020">16</td>
<td title="Wednesday, June 17, 2020">17</td>
<td title="Thursday, June 18, 2020">18</td>
<td title="Friday, June 19, 2020">19</td>
<td class="rcWeekend" title="Saturday, June 20, 2020">20</td>
<td class="rcWeekend" title="Sunday, June 21, 2020">21</td>
</tr>
<tr class="rcRow">
<th id="radUpToDatePicker_calendar_Top_rs_5" scope="row">26</th>
<td title="Monday, June 22, 2020">22</td>
<td title="Tuesday, June 23, 2020">23</td>
<td title="Wednesday, June 24, 2020">24</td>
<td title="Thursday, June 25, 2020">25</td>
<td title="Friday, June 26, 2020">26</td>
<td class="rcWeekend" title="Saturday, June 27, 2020">27</td>
<td class="rcWeekend" title="Sunday, June 28, 2020">28</td>
</tr>
<tr class="rcRow">
<th id="radUpToDatePicker_calendar_Top_rs_6" scope="row">27</th>
<td title="Monday, June 29, 2020">29</td>
<td title="Tuesday, June 30, 2020">30</td>
<td class="rcOtherMonth" title="Wednesday, July 01, 2020">1</td>
<td class="rcOtherMonth" title="Thursday, July 02, 2020">2</td>
<td class="rcOtherMonth" title="Friday, July 03, 2020">3</td>
<td class="rcOtherMonth" title="Saturday, July 04, 2020">4</td>
<td class="rcOtherMonth" title="Sunday, July 05, 2020">5</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
The javascript I found which has something to do with this (as it references the date), but which I can't figure out.
<script type="text/javascript">
//<![CDATA[
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadDateInput, {
"_displayText": "16/06/2020",
"_focused": false,
"_initialValueAsText": "2020-06-16-00-00-00",
"_postBackEventReferenceScript": "__doPostBack(\u0027radUpToDatePicker\u0027,\u0027\u0027)",
"_skin": "Default",
"_validationText": "2020-06-16-00-00-00",
"autoPostBack": true,
"clientStateFieldID": "radUpToDatePicker_dateInput_ClientState",
"dateFormat": "dd/MM/yyyy",
"dateFormatInfo": {
"DayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
"MonthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""],
"AbbreviatedDayNames": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
"AbbreviatedMonthNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""],
"AMDesignator": "AM",
"PMDesignator": "PM",
"DateSeparator": "/",
"TimeSeparator": ":",
"FirstDayOfWeek": 1,
"DateSlots": {
"Month": 1,
"Day": 0,
"Year": 2
},
"ShortYearCenturyEnd": 2029,
"TimeInputOnly": false
},
"displayDateFormat": "dd/MM/yyyy",
"enabled": true,
"incrementSettings": {
InterceptArrowKeys: true,
InterceptMouseWheel: true,
Step: 1
},
"styles": {
HoveredStyle: ["width:100%;", "riTextBox riHover"],
InvalidStyle: ["width:100%;", "riTextBox riError"],
DisabledStyle: ["width:100%;", "riTextBox riDisabled"],
FocusedStyle: ["width:100%;", "riTextBox riFocused"],
EmptyMessageStyle: ["width:100%;", "riTextBox riEmpty"],
ReadOnlyStyle: ["width:100%;", "riTextBox riRead"],
EnabledStyle: ["width:100%;", "riTextBox riEnabled"]
}
}, null, null, $get("radUpToDatePicker_dateInput"));
});
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadCalendar, {
"_DayRenderChangedDays": {},
"_FormatInfoArray": [
["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""],
["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""], "dd MMMM yyyy HH:mm:ss", "dd MMMM yyyy", "HH:mm:ss", "d MMMM", "ddd, dd MMM yyyy HH\u0027:\u0027mm\u0027:\u0027ss \u0027GMT\u0027", "dd/MM/yyyy", "HH:mm", "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss", "yyyy\u0027-\u0027MM\u0027-\u0027dd HH\u0027:\u0027mm\u0027:\u0027ss\u0027Z\u0027", "MMMM yyyy", "AM", "PM", "/", ":", 1
],
"_ViewRepeatableDays": {},
"_ViewsHash": {
"radUpToDatePicker_calendar_Top": [
[2020, 6, 1], 1
]
},
"_calendarWeekRule": 2,
"_culture": "en-GB",
"_enableKeyboardNavigation": false,
"_enableViewSelector": false,
"_firstDayOfWeek": 7,
"_postBackCall": "__doPostBack(\u0027radUpToDatePicker$calendar\u0027,\u0027##\u0027)",
"_rangeSelectionMode": 0,
"clientStateFieldID": "radUpToDatePicker_calendar_ClientState",
"enableMultiSelect": false,
"enabled": true,
"monthYearNavigationSettings": ["Today", "OK", "Cancel", "Date is out of range.", "False", "True", "300", "1", "300", "1", "False"],
"skin": "Default",
"specialDaysArray": [],
"stylesHash": {
"DayStyle": ["", ""],
"CalendarTableStyle": ["", "rcMainTable"],
"OtherMonthDayStyle": ["", "rcOtherMonth"],
"TitleStyle": ["", ""],
"SelectedDayStyle": ["", "rcSelected"],
"SelectorStyle": ["", ""],
"DisabledDayStyle": ["", "rcDisabled"],
"OutOfRangeDayStyle": ["", "rcOutOfRange"],
"WeekendDayStyle": ["", "rcWeekend"],
"DayOverStyle": ["", "rcHover"],
"FastNavigationStyle": ["", "RadCalendarMonthView RadCalendarMonthView_Default"],
"ViewSelectorStyle": ["", "rcViewSel"]
},
"useColumnHeadersAsSelectors": false,
"useRowHeadersAsSelectors": false
}, null, null, $get("radUpToDatePicker_calendar"));
});
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadDatePicker, {
"_PopupButtonSettings": {
ResolvedImageUrl: "",
ResolvedHoverImageUrl: ""
},
"_animationSettings": {
ShowAnimationDuration: 300,
ShowAnimationType: 1,
HideAnimationDuration: 0,
HideAnimationType: 1
},
"_popupControlID": "radUpToDatePicker_popupButton",
"clientStateFieldID": "radUpToDatePicker_ClientState",
"focusedDate": "2020-06-16-00-00-00"
}, null, {
"calendar": "radUpToDatePicker_calendar",
"dateInput": "radUpToDatePicker_dateInput"
}, $get("radUpToDatePicker"));
});
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadDateInput, {
"_displayText": "11/06/2020",
"_focused": false,
"_initialValueAsText": "2020-06-11-00-00-00",
"_postBackEventReferenceScript": "__doPostBack(\u0027radFromDatePicker\u0027,\u0027\u0027)",
"_skin": "Default",
"_validationText": "2020-06-11-00-00-00",
"autoPostBack": true,
"clientStateFieldID": "radFromDatePicker_dateInput_ClientState",
"dateFormat": "dd/MM/yyyy",
"dateFormatInfo": {
"DayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
"MonthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""],
"AbbreviatedDayNames": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
"AbbreviatedMonthNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""],
"AMDesignator": "AM",
"PMDesignator": "PM",
"DateSeparator": "/",
"TimeSeparator": ":",
"FirstDayOfWeek": 1,
"DateSlots": {
"Month": 1,
"Day": 0,
"Year": 2
},
"ShortYearCenturyEnd": 2029,
"TimeInputOnly": false
},
"displayDateFormat": "dd/MM/yyyy",
"enabled": true,
"incrementSettings": {
InterceptArrowKeys: true,
InterceptMouseWheel: true,
Step: 1
},
"styles": {
HoveredStyle: ["width:100%;", "riTextBox riHover"],
InvalidStyle: ["width:100%;", "riTextBox riError"],
DisabledStyle: ["width:100%;", "riTextBox riDisabled"],
FocusedStyle: ["width:100%;", "riTextBox riFocused"],
EmptyMessageStyle: ["width:100%;", "riTextBox riEmpty"],
ReadOnlyStyle: ["width:100%;", "riTextBox riRead"],
EnabledStyle: ["width:100%;", "riTextBox riEnabled"]
}
}, null, null, $get("radFromDatePicker_dateInput"));
});
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadCalendar, {
"_DayRenderChangedDays": {},
"_FormatInfoArray": [
["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""],
["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""], "dd MMMM yyyy HH:mm:ss", "dd MMMM yyyy", "HH:mm:ss", "d MMMM", "ddd, dd MMM yyyy HH\u0027:\u0027mm\u0027:\u0027ss \u0027GMT\u0027", "dd/MM/yyyy", "HH:mm", "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss", "yyyy\u0027-\u0027MM\u0027-\u0027dd HH\u0027:\u0027mm\u0027:\u0027ss\u0027Z\u0027", "MMMM yyyy", "AM", "PM", "/", ":", 1
],
"_ViewRepeatableDays": {},
"_ViewsHash": {
"radFromDatePicker_calendar_Top": [
[2020, 6, 1], 1
]
},
"_calendarWeekRule": 2,
"_culture": "en-GB",
"_enableKeyboardNavigation": false,
"_enableViewSelector": false,
"_firstDayOfWeek": 7,
"_postBackCall": "__doPostBack(\u0027radFromDatePicker$calendar\u0027,\u0027##\u0027)",
"_rangeSelectionMode": 0,
"clientStateFieldID": "radFromDatePicker_calendar_ClientState",
"enableMultiSelect": false,
"enabled": true,
"monthYearNavigationSettings": ["Today", "OK", "Cancel", "Date is out of range.", "False", "True", "300", "1", "300", "1", "False"],
"skin": "Default",
"specialDaysArray": [],
"stylesHash": {
"DayStyle": ["", ""],
"CalendarTableStyle": ["", "rcMainTable"],
"OtherMonthDayStyle": ["", "rcOtherMonth"],
"TitleStyle": ["", ""],
"SelectedDayStyle": ["", "rcSelected"],
"SelectorStyle": ["", ""],
"DisabledDayStyle": ["", "rcDisabled"],
"OutOfRangeDayStyle": ["", "rcOutOfRange"],
"WeekendDayStyle": ["", "rcWeekend"],
"DayOverStyle": ["", "rcHover"],
"FastNavigationStyle": ["", "RadCalendarMonthView RadCalendarMonthView_Default"],
"ViewSelectorStyle": ["", "rcViewSel"]
},
"useColumnHeadersAsSelectors": false,
"useRowHeadersAsSelectors": false
}, null, null, $get("radFromDatePicker_calendar"));
});
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadDatePicker, {
"_PopupButtonSettings": {
ResolvedImageUrl: "",
ResolvedHoverImageUrl: ""
},
"_animationSettings": {
ShowAnimationDuration: 300,
ShowAnimationType: 1,
HideAnimationDuration: 0,
HideAnimationType: 1
},
"_popupControlID": "radFromDatePicker_popupButton",
"clientStateFieldID": "radFromDatePicker_ClientState",
"focusedDate": "2020-06-16-00-00-00"
}, null, {
"calendar": "radFromDatePicker_calendar",
"dateInput": "radFromDatePicker_dateInput"
}, $get("radFromDatePicker"));
});
//]]>
</script>
</form>
</body>
</html>
<script language="javascript" type="text/javascript">
// telerik controls are not registered on a javascript window.onload, so wait a little while first.
setTimeout("setRadioButtonState()", 200);
</script>

How to remove [] in qweb when print sql output

I run this code for odoo 12
i need the output just 2
but when i print, the print out show [2]
can someone help me to remove [] in qweb
get_report is method to print report
This my python code:
#api.multi
#Call when button 'Get Report' clicked
def get_report(self):
sql = """SELECT 1+1"""
self.env.cr.execute(sql)
res_one = self.env.cr.fetchone()
data = {
'ids': self.ids,
'model': self._name,
'form': {
'sql': res_one
},
}
###use self.env.ref('module_name.report_id') as reference. report_action() will call
###_get_report_values() and pass 'data{}' automatically.
return self.env.ref('trabaud.recap_report').report_action(self, data=data)
#api.multi
def _get_report_values(self, docids, data=None):
sql = data['form']['sql']
return {
'sql': sql
}
This My XML
<table style="width:100%;">
<tr style="text-align:center">
<td style="width:30%;"/>
<td style="width:15%; text-align:left; padding: 0px;">Kode Barang</td>
<td style="width:2%; text-align:left; padding: 0px;">:</td>
<td style="width:23%; text-align:left; padding: 0px;"><b><span t-esc="kode"/></b></td>
<td style="width:30%;"/>
</tr>
<tr style="text-align:center">
<td style="width:30%;"/>
<td style="width:15%; text-align:left; padding: 0px;">Lokasi</td>
<td style="width:2%; text-align:left; padding: 0px;">:</td>
<td style="width:23%; text-align:left; padding: 0px;"><b><span t-esc="gudang_name"/></b></td>
<td style="width:30%;"/>
</tr>
<tr style="text-align:center">
<td style="width:30%;"/>
<td style="width:15%; text-align:left; padding: 0px;">Tahun</td>
<td style="width:2%; text-align:left; padding: 0px;">:</td>
<td style="width:23%; text-align:left; padding: 0px;"><b><span t-esc="sql"/></b></td>
<td style="width:30%;"/>
</tr>
</table>
and this print out result (https://i.stack.imgur.com/PlSUe.png)

Excel formula to find the nearest values

Is it possible to find the nearest value (+or-) with formula and display the 1st row value & 1st column value in my linked excel table?
Eg:
Search Value is "7,30" (C12; variable can ask for any value on table)
Found row value is "7" (E12 with formula; adressed to A7)
Found column value "4,00%" (E13 with formula; adressed to E1)
"F12" Formula is OK. What can be the formula in "F13" regarding the information on table below?
<head>
<meta http-equiv=Content-Type content="text/html; charset=Windows-1254">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 14">
<link rel=File-List href="SampleT_dosyalar/filelist.xml">
<style id="table-3_9841_Styles">
<!--table
{mso-displayed-decimal-separator:"\,";
mso-displayed-thousand-separator:"\.";}
.xl159841
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:black;
font-size:11.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Calibri, sans-serif;
mso-font-charset:162;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
mso-background-source:auto;
mso-pattern:auto;
white-space:nowrap;}
.xl659841
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:black;
font-size:11.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Calibri, sans-serif;
mso-font-charset:162;
mso-number-format:General;
text-align:right;
vertical-align:bottom;
mso-background-source:auto;
mso-pattern:auto;
white-space:nowrap;}
.xl669841
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:black;
font-size:11.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Calibri, sans-serif;
mso-font-charset:162;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
border:.5pt solid windowtext;
mso-background-source:auto;
mso-pattern:auto;
white-space:nowrap;}
.xl679841
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:black;
font-size:11.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Calibri, sans-serif;
mso-font-charset:162;
mso-number-format:Fixed;
text-align:general;
vertical-align:bottom;
border:.5pt solid windowtext;
mso-background-source:auto;
mso-pattern:auto;
white-space:nowrap;}
.xl689841
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:black;
font-size:11.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Calibri, sans-serif;
mso-font-charset:162;
mso-number-format:"0\.00\\%";
text-align:general;
vertical-align:bottom;
mso-background-source:auto;
mso-pattern:auto;
white-space:nowrap;}
.xl699841
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:black;
font-size:11.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Calibri, sans-serif;
mso-font-charset:162;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
background:#FFC000;
mso-pattern:black none;
white-space:nowrap;}
.xl709841
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:black;
font-size:11.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Calibri, sans-serif;
mso-font-charset:162;
mso-number-format:"0\.00\\%";
text-align:general;
vertical-align:bottom;
background:#FFC000;
mso-pattern:black none;
white-space:nowrap;}
.xl719841
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:black;
font-size:11.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Calibri, sans-serif;
mso-font-charset:162;
mso-number-format:"0\.00\\%";
text-align:general;
vertical-align:bottom;
border:.5pt solid windowtext;
mso-background-source:auto;
mso-pattern:auto;
white-space:nowrap;}
.xl729841
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:black;
font-size:11.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Calibri, sans-serif;
mso-font-charset:162;
mso-number-format:General;
text-align:left;
vertical-align:top;
border:none;
mso-diagonal-up:.5pt solid windowtext;
mso-background-source:auto;
mso-pattern:auto;
white-space:normal;}
.xl739841
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:red;
font-size:11.0pt;
font-weight:700;
font-style:normal;
text-decoration:none;
font-family:Calibri, sans-serif;
mso-font-charset:162;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
mso-background-source:auto;
mso-pattern:auto;
white-space:nowrap;}
.xl749841
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:#0070C0;
font-size:11.0pt;
font-weight:700;
font-style:normal;
text-decoration:none;
font-family:Calibri, sans-serif;
mso-font-charset:162;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
mso-background-source:auto;
mso-pattern:auto;
white-space:nowrap;}
.xl759841
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:black;
font-size:11.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Calibri, sans-serif;
mso-font-charset:162;
mso-number-format:General;
text-align:center;
vertical-align:bottom;
mso-background-source:auto;
mso-pattern:auto;
white-space:nowrap;}
.xl769841
{padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:black;
font-size:11.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Calibri, sans-serif;
mso-font-charset:162;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
background:#D9D9D9;
mso-pattern:black none;
white-space:nowrap;}
-->
</style>
</head>
<body>
<!--[if !excel]> <![endif]-->
<!--Aşağıdaki bilgiler Microsoft Excel'in Web Sayfası Olarak Yayımlama
sihirbazı tarafından oluşturuldu.-->
<!--Aynı öğe Excel'den yeniden yayımlanırsa, DIV etiketleri arasındaki
bilgilerin tümü değiştirilecek.-->
<!----------------------------->
<!--EXCEL WEB SAYFASI OLARAK YAYIMLA SİHİRBAZI ÇIKTI BAŞLANGICI-->
<!----------------------------->
<div id="table-3_9841" align=center x:publishsource="Excel">
<table border=0 cellpadding=0 cellspacing=0 width=1114 style='border-collapse:
collapse;table-layout:fixed;width:836pt'>
<col class=xl159841 width=26 style='mso-width-source:userset;mso-width-alt:
950;width:20pt'>
<col class=xl159841 width=64 style='width:48pt'>
<col width=64 span=16 style='width:48pt'>
<tr class=xl159841 height=20 style='height:15.0pt'>
<td height=20 class=xl769841 width=26 style='height:15.0pt;width:20pt'> </td>
<td class=xl759841 width=64 style='width:48pt'>A</td>
<td class=xl759841 width=64 style='width:48pt'>B</td>
<td class=xl759841 width=64 style='width:48pt'>C</td>
<td class=xl759841 width=64 style='width:48pt'>D</td>
<td class=xl759841 width=64 style='width:48pt'>E</td>
<td class=xl759841 width=64 style='width:48pt'>F</td>
<td class=xl759841 width=64 style='width:48pt'>H</td>
<td class=xl759841 width=64 style='width:48pt'>I</td>
<td class=xl759841 width=64 style='width:48pt'>J</td>
<td class=xl759841 width=64 style='width:48pt'>K</td>
<td class=xl759841 width=64 style='width:48pt'>L</td>
<td class=xl759841 width=64 style='width:48pt'>M</td>
<td class=xl759841 width=64 style='width:48pt'>N</td>
<td class=xl759841 width=64 style='width:48pt'>O</td>
<td class=xl759841 width=64 style='width:48pt'>P</td>
<td class=xl759841 width=64 style='width:48pt'>Q</td>
<td class=xl759841 width=64 style='width:48pt'>R</td>
</tr>
<tr height=20 style='mso-height-source:userset;height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>1</td>
<td rowspan=2 class=xl729841 width=64 style='width:48pt'><span
style='mso-spacerun:yes'> </span>%<br>
<span style='mso-spacerun:yes'> </span>Price</td>
<td class=xl689841 align=right>1,00%</td>
<td class=xl689841 align=right>2,00%</td>
<td class=xl689841 align=right>3,00%</td>
<td class=xl709841 align=right>4,00%</td>
<td class=xl689841 align=right>5,00%</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>2</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>3</td>
<td class=xl159841 align=right>3</td>
<td class=xl159841 align=right><a name="RANGE!C4:G11">3,03</a></td>
<td class=xl159841 align=right>3,06</td>
<td class=xl159841 align=right>3,095</td>
<td class=xl159841 align=right>3,125</td>
<td class=xl159841 align=right>3,16</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>4</td>
<td class=xl159841 align=right>4</td>
<td class=xl159841 align=right>4,04</td>
<td class=xl159841 align=right>4,08</td>
<td class=xl159841 align=right>4,125</td>
<td class=xl159841 align=right>4,165</td>
<td class=xl159841 align=right>4,21</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>5</td>
<td class=xl159841 align=right>5</td>
<td class=xl159841 align=right>5,05</td>
<td class=xl159841 align=right>5,1</td>
<td class=xl159841 align=right>5,155</td>
<td class=xl159841 align=right>5,21</td>
<td class=xl159841 align=right>5,265</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>6</td>
<td class=xl159841 align=right>6</td>
<td class=xl159841 align=right>6,06</td>
<td class=xl159841 align=right>6,12</td>
<td class=xl159841 align=right>6,185</td>
<td class=xl159841 align=right>6,25</td>
<td class=xl739841 align=right>7,29</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>7</td>
<td class=xl699841 align=right>7</td>
<td class=xl159841 align=right>7,07</td>
<td class=xl159841 align=right>7,145</td>
<td class=xl159841 align=right>7,215</td>
<td class=xl739841 align=right>7,29</td>
<td class=xl159841 align=right>7,37</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>8</td>
<td class=xl159841 align=right>8</td>
<td class=xl159841 align=right>8,08</td>
<td class=xl159841 align=right>8,165</td>
<td class=xl159841 align=right>8,245</td>
<td class=xl159841 align=right>8,335</td>
<td class=xl159841 align=right>8,42</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>9</td>
<td class=xl159841 align=right>9</td>
<td class=xl159841 align=right>9,09</td>
<td class=xl159841 align=right>9,185</td>
<td class=xl159841 align=right>9,28</td>
<td class=xl159841 align=right>9,375</td>
<td class=xl159841 align=right>9,475</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>10</td>
<td class=xl159841 align=right>10</td>
<td class=xl159841 align=right>10,1</td>
<td class=xl159841 align=right>10,205</td>
<td class=xl159841 align=right>10,31</td>
<td class=xl159841 align=right>10,415</td>
<td class=xl159841 align=right>10,525</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>11</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>12</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl659841>Search:</td>
<td class=xl679841 align=right>7,30</td>
<td class=xl659841>Row</td>
<td class=xl669841 align=right>7</td>
<td class=xl159841 colspan=11><span style='mso-spacerun:yes'>
</span>=İNDİS($A:$A;MAK((MİN(MUTLAK(DataRange-$C$12))=MUTLAK(DataRange-$C$12))*SATIR(DataRange)))</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>13</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl659841>Column</td>
<td class=xl719841 align=right style='border-top:none'>5,00%</td>
<td class=xl159841 colspan=11><span style='mso-spacerun:yes'>
</span>=İNDİS($1:$1;1;MAK((MİN(MUTLAK(DataRange-$C$12))=MUTLAK(DataRange-$C$12))*SÜTUN(DataRange)))</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>14</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>15</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl749841 colspan=10>This formula is OK as row# "7" but is
it possible to display "E7" instead of "F6" as column
title?</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>16</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl749841 colspan=12>Can the formula check row# first to retrieve
the colum title then check for others if no figure is identical in row
"7" line?</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl759841 style='height:15.0pt'>18</td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
<td class=xl159841></td>
</tr>
<![if supportMisalignedColumns]>
<tr height=0 style='display:none'>
<td width=26 style='width:20pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
</tr>
<![endif]>
</table>
</div>
<!----------------------------->
<!--EXCEL WEB SAYFASI OLARAK YAYIMLA SİHİRBAZI ÇIKTI SONU-->
<!----------------------------->
</body>
</html>
I guess there must be a prettier answer to this, but this worked for me:
In E12 put this:
=ROUNDDOWN(C12,0)
And in E13 put this Array-Formula (need to be entered with Ctrl+Shift+Enter instead of the usual Enter):
=MATCH(MIN(ABS(C12-B3:F10)),ABS(C12-INDIRECT(CONCATENATE("B",E12)):INDIRECT(CONCATENATE("F",E12))),0)
Hope this helps
These formulas must be array-entered:
Row: =INDEX($A:$A,MAX((MIN(ABS(DataRange-$C$12))=ABS(DataRange-$C$12))*ROW(DataRange)))
Column: =INDEX($1:$1,1,MAX((MIN(ABS(DataRange-$C$12))=ABS(DataRange-$C$12))*COLUMN(DataRange)))
EDIT: If there is a possibility of duplicates in the table (two values that are equidistant from the search value, then the following formula will ensure that Column comes from the same row as the row value found.
Row: Formula in C12
Column: =INDEX($1:$1,1,MAX((MIN(ABS(INDEX(DataRange,E12-ROW(DataRange)+1,0)-$C$12))=ABS(INDEX(DataRange,E12-ROW(DataRange)+1,0)-$C$12))*COLUMN(DataRange)))
In your example,
DataRange refers to: =Sheet1!$B$3:$F$10
To array-enter a formula, after entering
the formula into the cell or formula bar, hold down
ctrl+shift while hitting enter. If you did this
correctly, Excel will place braces {...} around the formula.
In E12, the row:
=INDEX(A:A,AGGREGATE(15,6,($B$3:$F$10)/(AGGREGATE(15,6,ABS(C12-$B$3:$F$10),1)=ABS(C12-$B$3:$F$10)),1))
In E13, the column:
=INDEX(1:1,AGGREGATE(15,6,COLUMN($B$3:$F$10)/(AGGREGATE(15,6,ABS(C12-$B$3:$F$10),1)=ABS(C12-$B$3:$F$10)),1))

Tinymce copy/paste from excel (Plugin BBcode)

I'm using tinyMCE, below you can see the implementation.
Now the problem: when I copy some records from EXCEL and paste them in my tinymce field. It's displayed good enough for me (with plugin: paste, he will actually show the fields)
When i ask the value from my field I get a return with a table struct depeding what you paste. But I don't want any html, see below what I want.
Implementation code:
tinyMCE.init({
mode : "exact",
elements: "id",
theme : "advanced",
plugins : "bbcode, inlinepopups",
content_css : "tinymce.css",
entity_encoding : "raw",
remove_linebreaks : false,
forced_root_block: false,
force_br_newlines: true,
invalid_elements : "p, div, span",
force_p_newlines: false, t
heme_advanced_buttons1 : $cur_buttons,
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
init_instance_callback : "tiny_mce_callback"});
Return from tinyMCE object:
<table style="border-collapse: collapse;" width="216" border="0"
cellspacing="0" cellpadding="0">
<!--StartFragment-->
<colgroup>
<col style="mso-width-source: userset; mso-width-alt: 1152;" width="27"/>
<col width="55" />
<col style="mso-width-source: userset; mso-width-alt: 2858;"
span="2" width="67"/>
</colgroup>
<tbody>
<tr style="mso-height-source: userset;">
<td class="xl24" width="27" height="12">1</td>
<td class="xl26" width="55">26/05/12</td>
<td class="xl24" width="67">Amsterdam</td>
<td class="xl24" width="67">Casablanca</td>
</tr>
<tr style="mso-height-source: userset;">
<td class="xl24" height="12">2</td>
<td class="xl25">27/05/12</td>
<td class="xl24">Casablanca</td>
<td class="xl24">Rabat</td>
</tr>
<tr style="mso-height-source: userset;">
<td class="xl24" height="12">3</td>
<td class="xl25">28/05/12</td>
<td class="xl24">Rabat</td>
<td class="xl24">Fes</td>
</tr>
<tr style="mso-height-source: userset;">
<td class="xl24" height="12">4</td>
<td class="xl25">29/05/12</td>
<td class="xl24">Fes</td>
<td class="xl24"> </td>
</tr>
<tr style="mso-height-source: userset;">
<td class="xl24" height="12">5</td>
<td class="xl25">30/05/12</td>
<td class="xl24">Fes</td>
<td class="xl24">Erg Chebbi</td>
</tr>
<tr style="mso-height-source: userset;">
<td class="xl24" height="12">6</td>
<td class="xl25">31/05/12</td>
<td class="xl24">Erg Chebbi</td>
<td class="xl24">Dades Vallei</td>
</tr>
<tr style="mso-height-source: userset;">
<td class="xl24" height="12">7</td>
<td class="xl25">01/06/12</td>
<td class="xl24">Dades Vallei</td>
<td class="xl24">Ouarzazate</td>
</tr>
<tr style="mso-height-source: userset;">
<td class="xl24" height="12">8</td>
<td class="xl25">02/06/12</td>
<td class="xl24">Ouarzazate</td>
<td class="xl24">Marrakesh</td>
</tr>
<tr style="mso-height-source: userset;">
<td class="xl24" height="12">9</td>
<td class="xl25">03/06/12</td>
<td class="xl24">Marrakesh</td>
<td class="xl24"> </td>
</tr>
<tr style="mso-height-source: userset;">
<td class="xl24" height="12">10</td>
<td class="xl25">04/06/12</td>
<td class="xl24">Marrakesh</td>
<td class="xl24"> </td>
</tr>
<tr style="mso-height-source: userset;">
<td class="xl24" height="12">11</td>
<td class="xl25">05/06/12</td>
<td class="xl24">Marrakesh</td>
<td class="xl24">Amsterdam</td>
</tr>
<!--EndFragment--></tbody>
</table>
Expected return:
1 26/05/12 Amsterdam Casablanca
2 27/05/12 Casablanca Rabat
3 28/05/12 Rabat Fes
4 29/05/12 Fes
5 30/05/12 Fes Erg Chebbi
6 31/05/12 Erg Chebbi Dades Vallei
7 01/06/12 Dades Vallei Ouarzazate
8 02/06/12 Ouarzazate Marrakesh
9 03/06/12 Marrakesh
10 04/06/12 Marrakesh
11 05/06/12 Marrakesh Amsterdam
You should have a look at the tinymce configuration options concerning the paste plugin.
Another option is to strip out all unwanted html tags and just use plain text: TinyMCE Paste As Plain Text

Resources