The following formulae are based on a 13 or 10 digit ISBN in cell A3 and cell A6 reserved for a check digit calculation. These should be in one line in a spreadsheet cell, the layout here is to help readability.
Formula to create ISBN-13 from ISBN-10
=if(
len(A3)<11,
concatenate(
"978",
mid(A3,1,9),
mod(
mid(A3,1,1)*3+
mid(A3,2,1)+
mid(A3,3,1)*3+
mid(A3,4,1)+
mid(A3,5,1)*3+
mid(A3,6,1)+
mid(A3,7,1)*3+
mid(A3,8,1)+
mid(A3,9,1)*3,
10
)
),
A3
)
Formula to create ISBN-10 from ISBN-13 (starting with 978)
=if(
len(A3)>10,
concatenate(
mid(A3,4,9),
if(A6=10,"X",A6)
),
A3
)
To calculate the check digit (A6)
=if(
len(A3)>10,
mod(
mid(A3,4,1)+
mid(A3,5,1)*2+
mid(A3,6,1)*3+
mid(A3,7,1)*4+
mid(A3,8,1)*5+
mid(A3,9,1)*6+
mid(A3,10,1)*7+
mid(A3,11,1)*8+
mid(A3,12,1)*9,
11
),
""
)
No comments:
Post a Comment