How to create a new function.

Jeffrey Hendriks

New Member
Joined
Sep 25, 2002
Messages
5
I know. This is a simple question. But I forgot. And I don't have the time to look it up in a book.

Anyone know how to add a new function. I need to write one to calculate Fahrenheit to Celsius. But I don't know how/where to add the new function.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Mudface

MrExcel MVP
Joined
Feb 18, 2002
Messages
3,339
The Convert function from the Analysis toolpak will do this (you may need to add it in via Tools-Add-ins). eg

=CONVERT(A1,"F","C")
 

Mudface

MrExcel MVP
Joined
Feb 18, 2002
Messages
3,339
The Convert function from the Analysis toolpak will do this (you may need to add it in via Tools-Add-ins). eg

=CONVERT(A1,"F","C")
 

Jeffrey Hendriks

New Member
Joined
Sep 25, 2002
Messages
5
Thankyou for pointing that out, but I need to create this function myself. I am not allowed to use an existing function. Any idea how to add my own custom function?
 

kskinne

Well-known Member
Joined
Feb 17, 2002
Messages
1,267
Office Version
  1. 365
Platform
  1. Windows
your formula to convert fahrenheit to celcius is:

(fahrenheit - 32) / (9 / 5)

and celcius to fahrenheit is:

(celcius * (5 / 9)) + 32

so if A1 houses a fahrenheit temp, convert it w/ this formula:

=(A1-32)/(9/5)

and if A1 houses a celcius temp, convert it w/ this formula:

=A1*(9/5)+32
 

Forum statistics

Threads
1,144,312
Messages
5,723,647
Members
422,508
Latest member
Lordkit1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top