We present a method to allocate multiple tasks with uncertainty to heterogeneous robots using the theory of comparative advantage: an economic theory that maximizes the benefit of specialization. In real applications, robots often must execute various tasks with uncertainty and future multirobot system will have to work effectively with people as a team. As an example, it may be necessary to explore an unknown environment while executing a main task with people, such as carrying, rescue, military, or construction. The proposed task allocation method is expected to reduce the total makespan (total length of task-execution time) compared with conventional methods in robotic exploration missions. We expect that our method is also effective in terms of calculation time compared with the time-extended allocation method (based on the solution of job-shop scheduling problems). We simulated carrying tasks and exploratory tasks, which include uncertainty conditions such as unknown work environments (2 tasks and 2 robots, multiple tasks and 2 robots, 2 robots and multiple tasks, and multiple tasks and multiple robots). In addition, we compared our method with full searching and methods that maximize the sum of efficiency in these simulations by several conditions: first, 2 tasks (carrying and exploring) in the four uncertain conditions (later time, new objects appearing, disobedient robots, and shorter carrying time) and second, many types of tasks to many types of robots in the three uncertain conditions (unknown carrying time, new objects appearing, and some reasonable agents). The proposed method is also effective in three terms: the task-execution time with an increasing number of objects, uncertain increase in the number of tasks during task execution, and uncertainty agents who are disobedient to allocation orders compared to full searching and methods that maximize the sum of efficiency. Additionally, we performed two real-world experiments with uncertainty.