Barcelona from New York JFK is priced from $376 round trip for nonstop flights with both American Airline and Delta Airlines for travel January through May, then mid-August into October. Even nonstop flights are available. Lowest fares in $300s are January to April for American, but you can even travel JFK to Barcelona in mid-June for $377 round trip with Delta Airlines on nonstop flights..
Madrid is in low $400s for winter dates.
TAP Portugal has some low fare dates with Star Alliance, but their outrageous checked bag fees make that ticket no bargain compared to AA and DL.
American Airlines New York JFK – Barcelona, Spain BCN nonstop
Delta Airlines New York JFK – Barcelona, Spain BCN nonstop