LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Viper5963
 
Posts: n/a
Default How can I subtract 111 from a number like 097 and get 987, using .

I am trying to take a number like 097, subtract 111. I don't want my new
number to become -186, instead I want 986. I am trying to use an IF
statement that looks like this:

=IF(LEFT(A1)
="0","9",LEFT(A1)-1&IF(MID(A1,2,1)="0","9",MID(A1,2,1)-1&IF(RIGHT(A1)="0","9",RIGHT((A1)-1))))

This works fine for the first number, but if I enter new numbers in the
column and copy the formula down, I get invalid data . Please help
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"