SOLVED

# CKD Epi Formula in an excel formula

Copper Contributor

# CKD Epi Formula in an excel formula

Hello, does anyone have the formula to calculate CKD EPI which reflects the renal function in medicine in one excel formula, the CKD EPI formula being :

CKD EPI Formula

Any help is highly appreciated, thank you in advance

18 Replies

# Re: CKD Epi Formula in an excel formula

With gender (Male or Female) in B2, Age (in years) in C2, and Scr in E2:

``=142*(D2/IF(D2<=0.7,0.7,0.9))^IF(B2="Female",-1.2,IF(D2<=0.7,-0.241,-0.302))*0.9938^C2*IF(B2="Female",1.012,1)``

See the attached workbook.

# Re: CKD Epi Formula in an excel formula

However, I got the formula from :
https://www.mdcalc.com/ckd-epi-equations-glomerular-filtration-rate-gfr#evidence
And I tried to compare the excel values and the values from the website.
B C F G match in values however the rest of the options seem to have different values
Do you know what might be the reason ?

# Re: CKD Epi Formula in an excel formula

The formula discriminates between Scr<=0.7 and Scr<=0.9, but does not specify what to use if Scr>0.9.

The website states that normal values for Scr are 62-115, and does not accept values below 0.89.

What gives?

# Re: CKD Epi Formula in an excel formula

Yes Hans, thank your for your reply, actually the values 62-115 refer to the normal serum creatinine in umol/L, however if you click on the parallel green arrows, the normal value shows between 0.7 and 1.3, these values are in mg/dL. And I think the Scr values in the equation are in mg/dL too.
Furthermore, in the table, if I am not mistaken, if Scr > 0.9 A = 0.9 B = -1.2

Thank you for your help Hans,
If you need anything else, don't hesitate to reach out !

best response confirmed by joecooper98 (Copper Contributor)
Solution

# Re: CKD Epi Formula in an excel formula

B1 = Scr
B2 = 0 for male, 1 for female
B3 = Age

=IF(B2=0;IF(B1>0.9;142*(B1/0.9)^-1.2*0.9938^B3;142*(B1/0.9)^-.302*0.9938^B3);IF(B1>0.7;142*(B1/0.7)^-1.2*0.9938^B3*1.012;142*(B1/0.7)^-0.241*0.9938^B3*1.012))

# Re: CKD Epi Formula in an excel formula

B1 = Scr
B2 = 0 for male, 1 for female
B3 = Age

=IF(B2=0;IF(B1>0.9;142*(B1/0.9)^-1.2*0.9938^B3;142*(B1/0.9)^-.302*0.9938^B3);IF(B1>0.7;142*(B1/0.7)^-1.2*0.9938^B3*1.012;142*(B1/0.7)^-0.241*0.9938^B3*1.012))

This solution worked best for me, thank you Hans

# Re: CKD Epi Formula in an excel formula

For those that can't get it to work in their version of Excel, replace the semicolons with commas :) Fixed equation is below with same variables

B1 = Scr
B2 = 0 for male, 1 for female
B3 = Age

=IF(B2=0,IF(B1>0.9,142*(B1/0.9)^-1.2*0.9938^B3,142*(B1/0.9)^-0.302*0.9938^B3),IF(B1>0.7,142*(B1/0.7)^-1.2*0.9938^B3*1.012,142*(B1/0.7)^-0.241*0.9938^B3*1.012))

# Re: CKD Epi Formula in an excel formula

@HansVogelaar I tried my data on that Excel but it gives wrong results...

# Re: CKD Epi Formula in an excel formula

That formula doesn't work...

# Re: CKD Epi Formula in an excel formula

Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?

# Re: CKD Epi Formula in an excel formula

For example, I used your Excel file EPI. Column E has the values according to your formula. Column F has the real values manually calculated according to CKD-EPI 2021 equation.

# Re: CKD Epi Formula in an excel formula

The one who started this discussion, @joecooper98, posted a corrected formula (marked as the solution). I have adjusted it for the layout of the sample workbook.

# Re: CKD Epi Formula in an excel formula

hi thank you for  your offert may i have this formal but with umol/L  and change 0 to male and 1 to female cux i have a big study for GFR and really need this formal as this site result.

as an excel sheet thank you

# Re: CKD Epi Formula in an excel formula

To my mind, this is an application that is absolutely crying out for an Excel 365 Lambda function!

``````CKD.Epi
= LAMBDA(Scr, age, [isFemale],
LET(
A, IF(isFemale, 0.7, 0.9),
B, IF(Src/A <= 1, IF(isFemale, -0.241, -0.302), -1.2),
142 * (Src/A)^B * 0.9938^age * 1.012^isFemale
)
)``````

The worksheet formula (one for the entire table) is then

``= CKD.Epi(Src, Age, Gender="Female")``

# Re: CKD Epi Formula in an excel formula

The image didn't come through?

# Re: CKD Epi Formula in an excel formula

@Peter Bartholomew

thank you for your respond but dose not work for me anymore

for me i want only to change the unit for umol/l , for gender i can fix it later

# Re: CKD Epi Formula in an excel formula

I am sorry the solution did not work out for you.  Do you use Excel 365; that is essential.

I am absolutely convinced, however, that the Lambda function offers the only sensible way forward in the longer term.

Thank you also for the link; it is good to improve my education even now.  I had rather assumed it was a linear regression model but it was good to be able to confirm it.

# Re: CKD Epi Formula in an excel formula

thank you for your kind respond

yes im using 365 Excel

could you find me i way cuz i need it for my big study?

thank you

1 best response

Accepted Solutions
best response confirmed by joecooper98 (Copper Contributor)
Solution

# Re: CKD Epi Formula in an excel formula

B1 = Scr
B2 = 0 for male, 1 for female
B3 = Age

=IF(B2=0;IF(B1>0.9;142*(B1/0.9)^-1.2*0.9938^B3;142*(B1/0.9)^-.302*0.9938^B3);IF(B1>0.7;142*(B1/0.7)^-1.2*0.9938^B3*1.012;142*(B1/0.7)^-0.241*0.9938^B3*1.012))