Reputation: 596
I need to format some data in excel and I don't know how to write a very specific function and even worse, I don't know how to google it. The code in C-like programming language would be as the following:
if(x>1000)
x = x/100+x%100;
else
x = x;
I know the format of Excel formula, but something like this, certainly doesn't work:
=IF(A2>1000,A2/100+A2%100,A2)
Any help regarding this problem would be highly appreciated!
Upvotes: 1
Views: 53
Reputation: 384
Do not use %.
Use MOD function instead.
How to: https://exceljet.net/excel-functions/excel-mod-function
Upvotes: 1
Reputation: 1975
Thanks for the clarification. Here is the excel formula.
=IF(A2>1000,INT(A2/100)+((A2/100)-INT(A2/100))*100,A2)
Upvotes: 0