+ Reply to Thread
Results 1 to 4 of 4

representing data

  1. #1
    Registered User
    Join Date
    10-06-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    1

    representing data

    I have a number in A2 (this number is always changing),so when the number changes, it needs to be reprensented in other cells with ranges..eg
    A B C D
    1 Cost 10-20 21-41 42-87
    2 17

    I want when A2 is 17, then 1 is represented in B2. When A2 changes to 21, B2 changes to 0 but C2 changes to 1. Can you help?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: representing data

    A formula would need to know what the criteria is for displaying the 1 or not. For instance, B2 shows 1 if A2 is 1-20, C2 shows 1 if A2 is 21-40, etc...

    B2: =IF(AND($A2>=1, $A2<=20), 1, "")
    C2: =IF(AND($A2>=21, $A2<=40), 1, "")

    etc....
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: representing data

    In B2:
    Please Login or Register  to view this content.
    In C2
    Please Login or Register  to view this content.
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,091

    Re: representing data

    Cell B2: =IF(AND($A2>=--LEFT(B$1,FIND("-",B$1)-1),$A2<=--RIGHT(B$1,LEN(B$1)-FIND("-",B$1))),1,0)

    and copy across

    Regards
    Attached Files Attached Files
    Last edited by TMS; 10-06-2011 at 04:19 PM. Reason: Example workbook uploaded
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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