+ Reply to Thread
Results 1 to 2 of 2

Trying to get difference...

  1. #1
    Registered User
    Join Date
    10-15-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    1

    Trying to get difference...

    I'm trying to figure out a formula that will display the difference between numbers in a particular set..

    I don't know if you can declare variables..
    I want A = any whole number between 3-5 , B = any whole number between 6-9, C = any whole number between 10-12

    I also have a button that will choose a random number between 3-12.
    Say the random number is 7..
    Group A would then result in -2 because A's highest value is 5 and 7-5=2.
    Group B would have no effect because 7 falls within B's criteria of 6-9
    Group C would have no effect either since it's more than 7.

    Basically I want to add a penalty equal to the difference between the random number and the highest number in the set that is less than it.

    I hope that makes sense... :/

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Trying to get difference...

    Change A1 in the below formula to your Random Number Cell

    =SUBSTITUTE(TRIM(IF(A1>5,"A="&A1-5&" ","")&IF(A1>9,"B="&A1-9&" ","")&IF(A1>12,"C="&A1-12&" ",""))," ",", ")


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] difference between .Row & .Value
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-19-2012, 06:34 AM
  2. Difference between =A1 and =+A1?
    By Zaraf in forum Excel General
    Replies: 2
    Last Post: 06-01-2011, 01:02 PM
  3. Replies: 0
    Last Post: 10-07-2008, 10:45 PM
  4. [SOLVED] charting a difference of 2 columns' w/o adding a difference column
    By Wab in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-26-2005, 10:05 PM
  5. [SOLVED] What is the difference...
    By Wazooli in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-22-2005, 07:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1