简体   繁体   中英

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

在此处输入图片说明

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). 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.

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:

在此处输入图片说明

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.

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

In English: =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:

=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:

Based on the new tabular format.

Formula for Column B (Name):

=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):

=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

End Result: 在此处输入图片说明

give this a try. paste into cell D8.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM