SOLVED

Excel Wenn(Und -> Status aktualisieren

%3CLINGO-SUB%20id%3D%22lingo-sub-3270002%22%20slang%3D%22de-DE%22%3EExcel%20If(And%20-%26gt%3B%20Refresh%20Status%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3270002%22%20slang%3D%22de-DE%22%3E%3CP%3EHello%20dear%20community%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20wanted%20to%20make%20working%20with%20Excel%20a%20little%20easier%2C%20but%20due%20to%20my%20lack%20of%20knowledge%20I%20am%20not%20able%20to%20do%20it%20myself.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBriefly%20to%20the%20process.%20It%20is%20a%20file%20in%20one%20list%20individual%20contracts%20are%20entered%20and%20in%20the%20other%2C%20the%20actual%20works%20covered%20by%20this%20contract%20(below%20the%20pictures).%20All%20this%20is%20entered%20manually%20so%20far.%20For%20this%20I%20have%20created%20an%20example%2C%20the%20actual%20table%20contains%20over%201000%20rows%2C%20which%20are%20added%20every%20day.%3C%2FP%3E%3CP%3EIt%20would%20help%20me%20a%20lot%20if%20Excel%20could%20relieve%20me%20of%20at%20least%20one%20task%20and%20automatically%20recognize%20when%20a%20contract%20is%20signed%20(status%20%22finished%22).%20So%20as%20soon%20as%20I%20change%20the%20status%20in%20the%20%22Contract%20Table%22%20to%20%22Done%22%2C%20he%20should%20set%20an%20%22x%22%20in%20the%20column%20%22Signed%22%20for%20all%20rows%20that%20fall%20under%20this%20contract%20in%20the%20%22Works%20Table%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20idea%20was%20to%20use%20the%20IF(AND%20function)%20here.%20The%20prerequisites%20were%2C%20if%20the%20contract%20name%20matches%20in%20both%20tables%2C%20the%20contract%20was%20created%20on%20the%20same%20date%20and%20the%20status%20in%20Table2%20is%20set%20to%20%22done%22%2C%20then%20an%20%22x%22%20should%20be%20set.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20the%20function%3A%20%3DIF(AND(C2%3DTable2!A%3AA%3B%20Table1!D2%3DTable2!B%3AB%3B%20Table2!D%3AD%3D%22done%22)%3B%22x%22%3B%22--%22).%20However%2C%20I%20did%20not%20receive%20the%20desired%20result.%20I%20think%20Excel%20checks%20if%20all%20rows%20in%20column%20B%20table2%20match%20the%20one%20name%20from%20table1%2C%20so%20I%20don't%20get%20the%20desired%20result.%20In%20this%20example%2C%20an%20%22x%22%20would%20have%20to%20be%20set%20for%20all%20works%20by%20%22Mike%20J.%22%20and%20%22John%22.%3C%2FP%3E%3CP%3EWhat%20would%20I%20have%20to%20change%20for%20Excel%20to%20do%20the%20%22x%22%20accordingly%2C%20or%20is%20there%20perhaps%20another%20solution%20here%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Tabelle1.PNG%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F359464iF5F8F0C86A2849A4%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Tabelle1.PNG%22%20alt%3D%22Table1.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Tabelle2.PNG%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F359465i17349ACF9EE9A1DF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Tabelle2.PNG%22%20alt%3D%22Table2.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThanks%20for%20the%20help.%3C%2FP%3E%3CP%3EGreetings%3C%2FP%3E%3CP%3EO.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3270002%22%20slang%3D%22de-DE%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3270078%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Wenn(Und%20-%26gt%3B%20Status%20aktualisieren%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3270078%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1346570%22%20target%3D%22_blank%22%3E%40Oskar_P_J%3C%2FA%3E%3CFONT%3E%26nbsp%3BA%20single%20cell%20is%20never%20equal%20to%20an%20entire%20column%2C%20so%20you%20IF%20will%20always%20return%20the%20%3CU%3E%3CEM%3Eif_false%20%3C%2FEM%3E%3C%2FU%3Evalue%20of%20%22--%22%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%3EYou%20probably%20need%20a%20formula%20with%20the%20structure%20demonstrated%20in%20the%20picture%20below%3A%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Riny_van_Eekelen_0-1648555633797.png%22%20style%3D%22width%3A%20546px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F359510i11BD54059051B2F4%2Fimage-dimensions%2F546x130%3Fv%3Dv2%22%20width%3D%22546%22%20height%3D%22130%22%20role%3D%22button%22%20title%3D%22Riny_van_Eekelen_0-1648555633797.png%22%20alt%3D%22Riny_van_Eekelen_0-1648555633797.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENote%20that%20it%20will%20only%20pick-up%20the%20first%20matching%20value%20though.%20If%20you%20are%20using%20MS365%20or%20Excel%202021%20there%20may%20be%20others%20ways.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3272445%22%20slang%3D%22de-DE%22%3ERe%3A%20Excel%20If(And%20-%26gt%3B%20Update%20Status%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3272445%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3BThank%20you%20for%20your%20help.%3C%2FP%3E%3CP%3EUnfortunately%2C%20I%20am%20a%20beginner%20in%20Excel.%20How%20can%20I%20apply%20your%20formula%20to%20my%20example%3F%20I%20get%20a%20bit%20confused%20with%20your%20example.%20Do%20I%20have%20to%20combine%20the%20two%20formulas%3F%20or%20is%20my%20formula%20completely%20wrong%3F%20Is%20there%20a%20way%20that%20Excel%20automatically%20searches%20for%20these%203%20criteria%20in%20the%20respective%20columns%20and%20sets%20an%20%22x%22%20if%20all%20three%20are%20met%3F%3C%2FP%3E%3CP%3EBy%20the%20way%2C%20I'm%20using%20MS365%20so%20maybe%20there's%20a%20simpler%20solution%3F%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20You%26nbsp%3B%3C%2FP%3E%3CP%3EO.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hallo liebe Community,

 

Ich wollte mir die Arbeit mit Excel etwas erleichtern, aufgrund meiner fehlenden Kenntnisse bin ich jedoch nicht in der Lage es selber zu machen.

 

Kurz zu dem Ablauf. Es handelt sich um eine Datei, in der einen Liste werden einzelne Verträge eingetragen und in der anderen, die tatsächlichen Werke die unter diesen Vertrag fallen (unten die Bilder). All das wird bis jetzt manuell eingetragen. Dazu habe ich ein Beispiel erstellt, die eigentliche Tabelle beinhaltet über 1000 Zeilen, die jeden Tag ergänzt werden.

Es würde mir sehr helfen, wenn Excel mir wenigstens eine Aufgabe abnehmen könnte und automatisch erkennt, wenn ein Vertrag unterzeichnet (Status "fertig") ist. Sobald ich also den Status in der "Vertragstabelle" auf "fertig" verändere, soll er bei allen Zeilen, die in der "Werktabelle" unter diesen Vertrag fallen in der Spalte "Unterzeichnet" ein "x" setzen.

 

Meine Idee war es hier die WENN(UND Funktion zu benutzen. Die Voraussetzungen waren, wenn der Vertragsname in beiden Tabellen übereinstimmt, der Vertrag am selben Datum erstellt wurde und der Status in Tabelle2 auf "fertig" ist, dann soll ein "x" gesetzt werden.

 

Hier die Funktion: =WENN(UND(C2=Tabelle2!A:A;Tabelle1!D2=Tabelle2!B:B;Tabelle2!D:D="fertig");"x";"--"). Das gewünschte Ergebnis habe ich jedoch nicht erhalten. Ich denke, Excel prüft, ob alle Zeilen in Spalte B Tabelle2 mit dem einen Namen aus Tabelle1 übereinstimmt, daher bekomme ich nicht das gewünschte Ergebnis. Bei diesem Beispiel müsste ein "x" bei allen Werken von "Mike J." und "John" gesetzt werden.

Was müsste ich verändern, damit Excel das "x" entsprechend macht, oder gibt es hier vielleicht eine andere Lösung?

Tabelle1.PNG

Tabelle2.PNG

Danke für die Hilfe.

Liebe Grüße

O. 

7 Replies

@Oskar_P_J A single cell is never equal to an entire column, so you IF will always return the if_false value of "--"

 

You probably need a formula with the structure demonstrated in the picture below:

Riny_van_Eekelen_0-1648555633797.png

 

Note that it will only pick-up the first matching value though. If you are using MS365 or Excel 2021 there may be others ways.

 

@Riny_van_Eekelen Thank you for your help.

Unfortunately, I am a beginner in Excel. How can I apply your formula to my example? I get a bit confused with your example. Do I have to combine the two formulas? or is my formula completely wrong? Is there a way that Excel automatically searches for these 3 criteria in the respective columns and sets an "x" if all three are met?

By the way, I'm using MS365 so maybe there's a simpler solution? 

Thank you 

O. 

@Oskar_P_J Perhaps you can share the file.

best response confirmed by Oskar_P_J (New Contributor)
Solution

@Oskar_P_J 

=IF(NOT(ISNA(VLOOKUP(Tabelle1!C2&Tabelle1!D2&"fertig",Tabelle2!A:A&Tabelle2!B:B&Tabelle2!D:D,1,FALSE))),"x","--")
=IF(NOT(ISNA(MATCH(Tabelle1!C2&Tabelle1!D2&"fertig",Tabelle2!A:A&Tabelle2!B:B&Tabelle2!D:D,0))),"x","--")

It seems to work with VLOOKUP or MATCH. Enter the formulas with ctrl+shift+enter if you don't work with Office365 or 2021.

@Quadruple_Pawn Thank you! I Think that should work.

@Quadruple_Pawn after applying the formula to my actual file, I noticed that excel has slowed down significantly. I'm sure it's because there are over 10,000 rows in one table and over 3,000 in the other, so quite a lot of data.
Is there any way to make the formula stop automatically once all criteria match once? Or maybe there is another way to speed up Excel despite the formula?

@Oskar_P_J 

=IF(NOT(ISNA(MATCH(Tabelle1!C2&Tabelle1!D2&"fertig",Tabelle2!$A$2:$A$10000&Tabelle2!$B$2:$B$10000&Tabelle2!$D$2:$D$10000,0))),"x","--")

This formula works quickly in my sheet. I adjusted the search matrix to the actual size of the spreadsheet.

 

The difference is that the search matrix in this formula is from row 2 to 10000:  Tabelle2!$A$2:$A$10000&Tabelle2!$B$2:$B$10000&Tabelle2!$D$2:$D$10000  .

 

In the other formula the search matrix is from row 1 to row 1048576:

Tabelle2!A:A&Tabelle2!B:B&Tabelle2!D:D .