ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   if formula (https://www.excelbanter.com/excel-worksheet-functions/230057-if-formula.html)

MSKC LLC

if formula
 
i need a formula that will do the following function: If A1 equals either
D/S, Sunday, or Daily and write 16.84 for D/S, 8.48 for Sunday, 8.06 for Daily

Per Jessen[_2_]

if formula
 
Hi

Try this:

=IF(A1="D/S",16.84,IF(A1="Sunday",8.48,IF(A1="Daily",8.06,"" )))

Regards,
Per

On 7 Maj, 00:43, MSKC LLC wrote:
i need a formula that will do the following function: *If A1 equals either
D/S, Sunday, or Daily and write 16.84 for D/S, 8.48 for Sunday, 8.06 for Daily



Dennis Tucker

if formula
 
This could be done using nested "if" functions, but it get long and messy.

It would be better to write a custom Excel worksheet function instead.
1. Open the VB editor.
2. Add a code module to the workbook.
3. write the following function;

Function MyConverter(InputValue as string) as single

Select Case InputValue
Case "D/S"
MyConverter=16.84
Case "Sunday"
MyConverter=8.48
Case "Daily"
MyConverter=8.06
End Select

End Function

4. Now in a cell like B1 enter the function call

=MyConverter(A1)

B1 should convert from cell A1.



Dennis


"MSKC LLC" wrote in message
...
i need a formula that will do the following function: If A1 equals either
D/S, Sunday, or Daily and write 16.84 for D/S, 8.48 for Sunday, 8.06 for
Daily




All times are GMT +1. The time now is 07:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com