Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to implement subtraction from a range

Greetings-
I am trying to subtract x-i. Both variables have values between 1-26. I want for the result to always be positive; i.e. if i is bigger than x, then the difference to be subtracted from 26. For example x=3, i=10 x-i=19. Can I do this with the formulas or should I write a vb script? I am new to vb, any help is greatly appreciated.
Sean
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 536
Default How to implement subtraction from a range

On Friday, November 23, 2012 2:02:23 PM UTC-8, wrote:
Greetings-

I am trying to subtract x-i. Both variables have values between 1-26. I want for the result to always be positive; i.e. if i is bigger than x, then the difference to be subtracted from 26. For example x=3, i=10 x-i=19.. Can I do this with the formulas or should I write a vb script? I am new to vb, any help is greatly appreciated.

Sean


Hi Sean,

I think this does what you want, if I understand correctly.
Where your x value is in column C & your i value is in column D.
The second formula is with 26 in cell B1.

=IF(C2D2,26-(C2-D2),D2-C2)
=IF(C2D2,B1-(C2-D2),D2-C2)

HTH
Regards,
Howard
Reply
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Implement time-out Ludo Excel Programming 4 August 31st 11 05:44 PM
How best to integrate/implement this? Ed from AZ Excel Programming 2 December 10th 08 09:06 PM
WNetGetUniversalName - how to implement in VBA? KR Excel Programming 1 March 16th 06 03:48 PM
Reference range of cells and perform subtraction or nothing depending on contents bob-hamilton Excel Worksheet Functions 3 February 5th 06 04:24 PM
How to implement an iRtdServer? Hans Guijt Excel Programming 4 October 24th 04 07:17 AM


All times are GMT +1. The time now is 10:29 AM.

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"