It's not the tire size you have to look at. P215/40Z/R17 W is your tire size, not the wheel size (it gives the general wheel size of 17 but there's more to it than that). You need to check the bolt pattern and center bore. If they match, they will probably fit. You can't just slap a set of wheels on a car because they have the same number of holes in them
For example, the 14" stock wheels from a 1990 Pontiac Grand Am will fit on a 2002 Chevrolet Cavalier, which usually has stock 15" wheels. They are different size wheels, but the bolt pattern is the same: 5x100, which means it has 5 bolt holes and the diameter of each hole is 100mm.
If I go to I can see a nice list of wheels from lots of cars that'll fit a car with the 5x100 bolt pattern.
If I check the 1990 Grand Am against the 2002 Cavalier, I can see that the Center Bore: 57.1 mm and Lug Size: M12 x 1.5 are exactly the same. This should ensure a good fit. This is also why a set of stock 1992 Accord wheels fit my 1999 Accord. They have the same bolt pattern and center bore size.
Tire size is a case to case thing. You may be able to swap tires off your old ones, but if the wheel is a different size they won't fit, most likely. Offset is something I have yet to completely grasp, but from what I gather it's the amount of tire that sticks out past the wheel well.
From a very quick search, a 2000 Celica has a 5x100 bolt pattern and the 2016 Accord has a 5x114.3 (which is most Accords' stock wheel bolt pattern). Considering Toyota once made a Cavalier, those Celica wheels would just about fit my Cavalier