Method for determining a value of the state of energy (SOE) of a rechargeable battery in a vehicle (1; 1), said battery being connected to an electric consumer ; said method comprising: - determining the state of charge (SOC) as a measure of the present capacity of said battery ; and - determining said state of energy (SOE) as an indication of at least the remaining charge and discharge energy of said battery ; characterized in that said method comprises calculating and determining said value of the state of energy (SOE) based on the following steps: - determining a state of energy (SOE) for charging said battery , based on said state of charge (SOC) of said battery , as calculated between the present state of charge (SOC*) and a highest allowed state of charge (SOCmax) in which no further charging of the battery is allowed, for a given battery current (I), - determining a state of energy (SOE) for discharging said battery , based on said state of charge (SOC) of said battery , as calculated between a lowest allowed state of charge (SOCmin), in which the battery must be charged in order to allow operation of the electric consumer , and the present state of charge (SOC*) for a given battery current (I), wherein - said highest allowed state of charge (SOCmax) and said lowest allowed state of charge (SOCmin) are related to the operation of said electric consumer and vary depending on a mode for operating said vehicle (1; 1) or electric consumer during charging or discharging of said battery wherein the state of energy (SOE) of the battery is determined from the area under a curve representing the relationship between the battery voltage (U) and the state of charge (SOC), wherein the battery voltage (U) corresponds to the sum of an open circuit voltage (OCV) and a voltage drop (R*I), and wherein the actual vehicle mode which is determined by the actual operating conditions of the vehicle is used to predict the applied or withdrawn rechargeable battery current, the highest allowed state of charge (SOCmax) and the lowest allowed state of charge (SOCmin) for charging or discharging the rechargeable battery. - determining the state of charge (SOC) as a measure of the present capacity of said battery ; and - determining said state of energy (SOE) as an indication of at least the remaining charge and discharge energy of said battery ; - determining a state of energy (SOE) for charging said battery , based on said state of charge (SOC) of said battery , as calculated between the present state of charge (SOC*) and a highest allowed state of charge (SOCmax) in which no further charging of the battery is allowed, for a given battery current (I), - determining a state of energy (SOE) for discharging said battery , based on said state of charge (SOC) of said battery , as calculated between a lowest allowed state of charge (SOCmin), in which the battery must be charged in order to allow operation of the electric consumer , and the present state of charge (SOC*) for a given battery current (I), wherein - said highest allowed state of charge (SOCmax) and said lowest allowed state of charge (SOCmin) are related to the operation of said electric consumer and vary depending on a mode for operating said vehicle (1; 1) or electric consumer during charging or discharging of said battery <EOS>