To calculate customer acquisition costs, divide your total sales and marketing expenses by the number of new B2B SaaS customers acquired during a specific period. Include all costs associated with marketing campaigns, sales efforts, and customer acquisition activities.