A method for determining a state of health of a battery in a vehicle provided with a combustion engine, comprising the steps of a) determining a state of charge of the battery; b) determining a battery temperature; c) determining a cranking temperature d) obtaining a cranking signal comprising a plurality of samples from the battery when the battery is discharged during cranking of the combustion engine; e) determining one or more cranking type classes based on the determined battery temperature and the determined cranking temperature; f) determining battery parameters from the cranking signal corresponding to the determined one or more cranking type classes; g) determining the state of health of the battery for the at least one or more cranking type classes from the battery parameters determined corresponding to the cranking type class in a current state, a vehicle identifier and historical battery parameters corresponding to the one or more cranking type classes determined in a historic state preceding the current state; and h) outputting the state of health; wherein determining the battery parameters from the cranking signal comprises obtaining an intermediate cranking signal; filtering the intermediate cranking signal; and determining the battery parameters from the filtered cranking signal; the method being characterized by: the determining a cranking temperature is based on an engine coolant temperature, an ambient temperature, an engine temperature and a time elapsed since the last trip; and the obtaining an intermediate cranking signal is based on the cranking signal and a window function and comprises: determining a minimum of the cranking signal; determining a maximum of the cranking signal between the first sample of the cranking signal and the determined minimum of the cranking signal; determining an endpoint of the cranking signal that corresponds to a sample number corresponding to a value that is equal to a predetermined coefficient multiplied by the determined maximum and the sample number is larger than the sample number corresponding to the determined minimum; wherein the window function is arranged to pass the samples between the determined maximum and the determined end point of the cranking signal and obtaining the passed samples as the intermediate cranking signal. a) determining a state of charge of the battery; b) determining a battery temperature; c) determining a cranking temperature d) obtaining a cranking signal comprising a plurality of samples from the battery when the battery is discharged during cranking of the combustion engine; e) determining one or more cranking type classes based on the determined battery temperature and the determined cranking temperature; f) determining battery parameters from the cranking signal corresponding to the determined one or more cranking type classes; g) determining the state of health of the battery for the at least one or more cranking type classes from the battery parameters determined corresponding to the cranking type class in a current state, a vehicle identifier and historical battery parameters corresponding to the one or more cranking type classes determined in a historic state preceding the current state; and h) outputting the state of health; determining a minimum of the cranking signal; determining a maximum of the cranking signal between the first sample of the cranking signal and the determined minimum of the cranking signal; determining an endpoint of the cranking signal that corresponds to a sample number corresponding to a value that is equal to a predetermined coefficient multiplied by the determined maximum and the sample number is larger than the sample number corresponding to the determined minimum; wherein the window function is arranged to pass the samples between the determined maximum and the determined end point of the cranking signal and obtaining the passed samples as the intermediate cranking signal.