This paper explores a data-driven distributed bipartite consensus tracking (DBCT) problem for discrete-time multi-agent systems (MASs) with coopetition networks under repeatable operations. To solve this problem, a time-varying linearization model along the iteration axis is first established by using the measurement input and output (I/O) data of agents. Then a data-driven distributed bipartite consensus iterative learning control (DBCILC) algorithm is proposed considering both fixed and switching topologies. Compared with existing bipartite consensus, the main characteristic is to construct the proposed control protocol without requiring any explicit or implicit information of MASs' mathematical model. The difference from existing iterative learning control (ILC) approaches is that both the cooperative interactions and antagonistic interactions, and time-varying switching topologies are considered. Furthermore, through rigorous theoretical analysis, the proposed DBCILC approach can guarantee the bipartite consensus reducing tracking errors in the limited iteration steps. Moreover, although not all agents can receive information from the virtual leader directly, the proposed distributed scheme can maintain the performance and reduce the costs of communication. The results of three examples further illustrate the correctness, effectiveness, and applicability of the proposed algorithm. INDEX TERMS Iterative control (ILC), Bipartite consensus, Data-driven control (DDC), Multi-agent systems (MASs), Nonlinear discrete-time systems.