ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   "E" or "O" for the first, even or odd digit in a number (https://www.excelbanter.com/excel-worksheet-functions/32273-%22e%22-%22o%22-first-even-odd-digit-number.html)

jenn

"E" or "O" for the first, even or odd digit in a number
 
hi there!

I need a formula, to say "E" if the first digit of a four-digit-number in A1
is even. and "O" if its odd. Thanks a lot!

Biff

Hi!

Try this:

=IF(A1="","",IF(MOD(LEFT(A1,1),2)=0,"E","O"))

Biff

"jenn" wrote in message
...
hi there!

I need a formula, to say "E" if the first digit of a four-digit-number in
A1
is even. and "O" if its odd. Thanks a lot!




Ron Rosenfeld

On Thu, 23 Jun 2005 19:53:01 -0700, "jenn"
wrote:

hi there!

I need a formula, to say "E" if the first digit of a four-digit-number in A1
is even. and "O" if its odd. Thanks a lot!



=IF(MOD(INT(A1/1000),2),"O","E")


--ron


All times are GMT +1. The time now is 04:51 PM.

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