Sheet 1中:
$("#updateBidButton").click(function () {
var bid_amount = document.getElementById("auction_bid_input").value;
var item_id = "<?php echo $this->item['id']?>";
var current_bid = "<?php echo $this->item['current_bid']?>";
var url_view = "<?php echo $this->item['url_view']?>";
$.ajax({
type: 'post',
url: "?module=items&controller=index&action=submitBid",
dataType: "text",
data: 'bid_amount=' + bid_amount + '&item_id=' + item_id + '¤t_bid=' + current_bid + '&url_view=' + url_view,
beforeSend: function () {
$('.auction_box').animate({
'backgroundColor': '#ffdead'
}, 400);
},
success: function (result) {
if (result == 'ok') {
$.get(window.location.href, function (data) {
$('.auction_box').animate({
'backgroundColor': '#A3D1A3'
}, 400);
});
} else {
alert(result);
$('.auction_box').animate({
'backgroundColor': '#FFBFBF'
}, 400);
}
}
});
});
Sheet 2中:
<form action="" method="post">
<div id="<?php echo $this->item['id']; ?>">
<div class="auction_bid_box">
<label for="auction_bid_input">
<!-- Starting bid EXISTS -->
<?php if ($this->item['bid_count'] >= '1') { ?>
You have until <?php echo $this->data['item']['auction_start']; ?> to update the current bid.
<!-- Starting bid is MISSING-->
<?php } else { ?>
You have until <?php echo $this->data['item']['auction_start']; ?> to enter a starting bid.
<?php } ?>
</label>
<span class="auction_bid_container">
<input id="auction_bid_input" type="text" maxlength="12"
class="middle nmr event-clear-focus"
name="bid_amount" value="Enter Bid"/>
<input id="updateBidButton" type="submit"
value="<?php echo $this->translate('Update'); ?>"
class="button grey-button num-items-button"/>
</span>
</div>
</div>
</form>
如果Sheet1中的[FID + Year]与Sheet2中的[fID + Year]相匹配,我想将Type2中的Type Value复制到Sheet1。
到目前为止我使用StackOverflow Q / A尝试了什么:[对于第2行,重复剩余行的模式]
FID YEAR Type
1 2009 #N/A
1 2010 #N/A
1 2011 #N/A
1 2012 #N/A
1 2013 #N/A
1 2014 #N/A
1 2015 #N/A
1 2016 #N/A
3 2008 #N/A
3 2009 #N/A
3 2010 #N/A
3 2011 #N/A
3 2012 #N/A
3 2013 #N/A
3 2014 #N/A
3 2015 #N/A
3 2016 #N/A
提供fID Year Type
3 2014 DP
3 2012 DP
3 2011 DP
4 CU
4 CU
4 CU
4 CU
6 2013 CU
6 2013 CU
=INDEX(Sheet2!A:D,MATCH(1,(Sheet2!A:A=A2)*(Sheet2!B:B=B2),0),3)
提供#N/A
答案 0 :(得分:2)
在表1和表2中,在A列的左侧插入一列。 在该列中,为两个工作表添加类似= B2&amp; C2的复合键。
这会将两列的值组合在一起,从而更容易查找它。
在表1的“类型”列中,添加= IFERROR(VLOOKUP(A2,Sheet2!$ A $ 1:$ D $ 10,4,FALSE),“”)如果是顶部单元格并将其向下拖动。 A2是复合键列中的单元格,Sheet2!$ A $ 1:$ D $ 10是Sheet 2表格的范围。