简体   繁体   English

Excel:检查列中是否已存在单元格值,然后减去并显示另一个值

[英]Excel: Check if cell value already exists in column, and then substract and show another value

I have 2 sheets, first one with values asigned to certain names我有 2 张纸,第一张有指定给某些名称的值

在此处输入图片说明

And second one is a control list Wich I update everyday:第二个是我每天更新的控制列表:

在此处输入图片说明

I want to get this updated list to show updated values while I add new rows, for example, if LEG "1" is already shown in the table, and I add a row at the bottom, value of "COR" (column D) should show value-SAL (column E).我想让这个更新的列表在我添加新行时显示更新的值,例如,如果表中已经显示了 LEG“1”,并且我在底部添加一行,“COR”的值(D 列)应显示值-SAL(E 列)。 Here's an image of what i'm looking to achieve, made by hand for the example:这是我想要实现的图像,为示例手工制作:

在此处输入图片说明

As you can see, in first place column D for LEG1 is 14, but as I take 7 off of it (SAL, column E) when I call the same value again in row 8, column D shows 7.如您所见,首先,LEG1 的 D 列是 14,但是当我在第 8 行再次调用相同的值时,我从它(SAL,E 列)中取出 7,D 列显示 7。

The same should happen if called it again at the bottom:如果在底部再次调用它,也会发生同样的情况:

在此处输入图片说明

Hope you understand what I'm trying to explain, this is my first time here!希望你能理解我要解释的内容,这是我第一次来这里!

Thanks in advance.提前致谢。

EDIT: This is what I got until now:编辑:这是我到现在为止得到的:

在此处输入图片说明

----A----------B---------C
1---x----------8---------3
2---y----------9---------2
3---z----------7---------3
4---y----------7---------3
5---x----------5---------5
6---x----------5---------0
7---y----------4---------2
8---y----------2---------2
9---z----------4---------4
0---y----------2---------0

============================================================= ================================================== ============

EDIT: I'll try to clarify even more what I'm trying to achieve:编辑:我将尝试进一步澄清我想要实现的目标:

This is the initial table that you would see.这是您将看到的初始表。 As I explain in column headers, values are called from DATA sheet, to be later modified in BASE sheet:正如我在列标题中所解释的,值是从数据表中调用的,稍后会在 BASE 表中进行修改:

在此处输入图片说明

As values are then called again on this table, newly added rows should check previous inputs and substract them, in order to see how many "items" are available left to take (image shown below is manually edited, not actually working like this right now):当值在这个表上再次被调用时,新添加的行应该检查以前的输入并减去它们,以查看还有多少“项目”可供选择(下图是手动编辑的,现在实际上不是这样工作的):

在此处输入图片说明

Ames answer almost got it, values are showing up as they sould (with substractions made) but there's a little "glitch" (should I call it like that?) that makes all previous values from that person change, and that isn't expected to happen:艾姆斯的回答几乎明白了,价值在他们的灵魂中出现(做了减法)但是有一个小“故障”(我应该这样称呼它吗?)使那个人以前的所有价值都改变了,这是意料之中的即将发生:

在此处输入图片说明

If you know a little tweak that would make this 100% functional, would be highly appreciated.如果您知道可以使此 100% 正常工作的小调整,将不胜感激。

Formula in use is: =INDICE(DATA!C$2:C$7;COINCIDIR(A2;DATA!A$2:A$7;0))-SUMAR.SI.CONJUNTO(D:D;A:A;A2)+D2使用的公式是: =INDICE(DATA!C$2:C$7;COINCIDIR(A2;DATA!A$2:A$7;0))-SUMAR.SI.CONJUNTO(D:D;A:A;A2)+D2

In English: =INDEX(DATA!C$2:C$7,MATCH(A2,DATA!A$2:A$7,0))-SUMIFS(D:D,A:A,A2)+D2英文: =INDEX(DATA!C$2:C$7,MATCH(A2,DATA!A$2:A$7,0))-SUMIFS(D:D,A:A,A2)+D2

Thanks in advance!提前致谢!

update (fix updating previous values):更新(修复更新以前的值):

Try this - formula starting from cell D2:试试这个 - 从单元格 D2 开始的公式:

=INDEX(I$2:I$7,MATCH(B2,G$2:G$7,0))-SUMIFS(E$2:E2,B$2:B2,B2)+E2

In Spanish:在西班牙语中:

=INDICE(I$2:I$7,COINCIDIR(B2,G$2:G$7,0))-SUMAR.SI.CONJUNTO(E$2:E2,B$2:B2,B2)+E2

在此处输入图片说明

update 2:更新2:

Based on the new tabular format.基于新的表格格式。

Formula for Column B (Name): B 列(名称)的公式:

=INDEX(G$2:G$7,MATCH(A2,F$2:F$7,0))

=INDICE(G$2:G$7,COINCIDIR(A2,F$2:F$7,0))

Formula for Column C (Left): C列的公式(左):

=INDEX(H$2:H$7,MATCH(A2,F$2:F$7,0))-SUMIFS(D$2:D2,A$2:A2,A2)+D2

=INDICE(H$2:H$7,COINCIDIR(A2,F$2:F$7,0))-SUMAR.SI.CONJUNTO(D$2:D2,A$2:A2,A2)+D2

English-Spanish Excel Function Translation 英西Excel函数翻译

End Result:最终结果: 在此处输入图片说明

give this a try.试试这个。 paste into cell D8.粘贴到单元格 D8 中。

=VLOOKUP($B8,$B:$D,3,FALSE)-SUMIFS($E$1:$E7,$B$1:$B7,B8) =VLOOKUP($B8,$B:$D,3,FALSE)-SUMIFS($E$1:$E7,$B$1:$B7,B8)

暂无
暂无

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

相关问题 检查其他多个工作表上是否存在excel单元格值-如果是,则返回存在于另一列中的工作表名称 - Check if an excel cell value exists on multiple other sheets - and if so return the name of the sheet it exists on in another column Excel-检查值是否存在于另一个工作表的列中并返回相邻列 - Excel - Check if value exists in a column in another worksheet and return adjacent column 检查SQL中是否存在excel单元格值 - check if excel cell value exists in SQL 如何检查单元格中的实际文本是否已经存在于Excel中的列中 - How to check if the actual text in the cell already exists in the column in excel 根据另一列上的 IF 语句在 Msgbox 中显示单元格值 - Excel VBA - Show cell value in a Msgbox based on IF statement on another column - Excel VBA Excel:检查列中是否存在单元格字符串值,并获取对该字符串的所有单元格引用 - Excel: Check if cell string value exists in column, and get all cell references to that string 检查Column中是否存在Cell值,然后获取NEXT Cell的值 - Check if Cell value exists in Column, and then get the value of the NEXT Cell 检查或查找值是否存在于另一列中 - Check Or Find If Value Exists In Another Column 如果值已经存在,VBA 宏不会将单元格复制到另一个工作表 - VBA Macro to not Copy Cell over to Another Sheet if Value Already Exists Excel公式,如果一列中单元格的值保持不变,但另一列中的值发生变化,则显示给我 - Excel Formula if the value of a cell in one column stays the same but the value in another changes then show me
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM