简体   繁体   English

如何根据列和行中提供的条件查找表单元格值?

[英]How to find table cell value based on condition provided in column and row?

Title might not be that descriptive, but didn't find a better one. 标题可能不具有描述性,但找不到更好的标题。 Basically please look at the screenshot: 基本上请看截图:

Excel屏幕截图

Table A1:I7 - is a table of Factors . 表A1:I7-是Factors表。 This is dictionary data which allows me to select the factor based on A and B values. 这是字典数据,可让我根据AB值选择因子。

Table A11:C15 - is a table where I have to put a lot of input data (pairs of A and B ) and want its Factor column to be populated using the Factors table. 表A11:C15-是一个表,我必须在其中放置很多输入数据( AB对),并希望使用Factors表填充其Factor列。

Is there a way to make Excel automatically calculate (or should I say - lookup) the value for the factor according to values of A and B in that row, without macro usage, just using formulas? 有没有一种方法可以使Excel根据该行中AB的值自动计算(或者说查找)因子的值,而无需使用宏,而仅使用公式?

Please try =INDEX($C$4:$H$7,MATCH($B11,$B$3:$B$7,1),MATCH($A11,$B$3:$H$3,1)) in C11 and copied down, but change B3:H3 to 0, 50, 60 etc and B4:B7 to 70, 80, 90, 100. (OOps - and insert a blank row at the top!) 请在C11中尝试=INDEX($C$4:$H$7,MATCH($B11,$B$3:$B$7,1),MATCH($A11,$B$3:$H$3,1))并向下复制,但将B3:H3更改为0、50、60等,并将B4:B7更改为70、80、90、100。(糟糕-在顶部插入空白行!)

Edit - slight problem with cell references! 编辑-单元格引用存在轻微问题! :

SO19276702的例子

This is a generalised solution. 这是一个广义的解决方案。 The nature of the factors (within limits, 1/10th change per step in every direction) may allow a simpler but more specific solution. 这些因素的性质(在一定范围内,每个方向上每步的变化为1/10)可以提供更简单但更具体的解决方案。

Also, formula should be wrapped in a condition that sets the factor to 0 when either A or B exceeds 100. Values such as 79.5 are not specifically catered for. 另外,公式应以当A或B超过100时将因子设置为0的条件进行包装。不专门满足诸如79.5之类的值。

I'm not sure there's a way to do this in the table you have presented. 我不确定您所提供的表格中是否可以执行此操作。 However, here's a start. 但是,这是一个开始。

Please take a look at Excel's VLOOKUP function. 请看一下Excel的VLOOKUP函数。 http://office.microsoft.com/en-us/excel-help/vlookup-HP005209335.aspx . http://office.microsoft.com/zh-cn/excel-help/vlookup-HP005209335.aspx HLOOKUP does the similar, but is a Horizontal lookup. HLOOKUP进行类似的操作,但是是水平查找。

You would have to do some minor tweaking to read the numbers for row 12 so that they do an HLOOKUP on row 5. (You would change the numbers in row 2 from a range to cutoff.) 您必须进行一些细微的调整才能读取第12行的数字,以便它们在第5行进行HLOOKUP。(您可以将第2行的数字从范围更改为截止值。)

Not sure how to do a VLOOKUP combined with an HLOOKUP, which seems to be what you need. 不确定如何将VLOOKUP与HLOOKUP结合使用,这似乎正是您所需要的。 I suppose you could multiply A by 100 and add in B and unroll the table into a long row. 我想您可以将A乘以100,然后加上B,然后将表格展开为一长行。

Yes, would be interesting if you would be able to lookup something, like you do it with a pivot table, just giving the conditions and the value shows up. 是的,如果您能够查找某些内容(例如使用数据透视表进行查找),只需给出条件并显示值,就会很有意思。 something like a sql query, strange it does not exist, answers above are not enough, if you ask me. 像sql查询之类的东西,奇怪的是不存在,如果您问我,上面的答案是不够的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在excel VBA中根据行和列ID查找单元格值 - How to find cell value based on row and Column ID in excel VBA Officescript如何通过行索引在表格单元格(行/列)中设置值 - Officescript how to set value in table cell (row/column) by row index 如何根据工作表最后一列中的单元格值隐藏行? - How to hide row based on cell value in last column of worksheet? Excel 宏根据匹配两个值(行/列)查找单元格并替换单元格中的值 - Excel Macro to find a cell based on matching two values (Row/Column) and replace value in cell 如何在Excel中基于行和行数据查找列值 - How to find column value based on row and row data in Excel 根据单元格值查找行的功能 - Function to find row based on cell value Excel:如何在包含字符串的列中查找单元格并在另一列行中返回单元格的值? - Excel: How to find cell in a column that contains a string and return value of a cell in another column of row? 根据列标题在最后一个单元格中查找值 - Find value in the last cell based on column header 用于根据单元格值查找和删除列的宏 - Macro to find and delete column based on cell value 如何基于同一行中的另一个单元格突出显示列中单元格值的所有实例? - How to highlight all instances of a cell value in a column based on another cell in same row?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM