+ Reply to Thread
Results 1 to 6 of 6

Enter a number depending on the value of the adjacent cell witjin ranges

  1. #1
    Registered User
    Join Date
    10-17-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    22

    Enter a number depending on the value of the adjacent cell witjin ranges

    Hi folks,

    This seems like a ridiculously easy thing to do - but I can't seem to work it out !

    I want Excel to enter a number for me in a cell adjacent to another cell which has a value that can fall within several ranges.

    For example :-

    if the value in cell D6 is between 8 and 16, I want Excel to place a 28 in cell C6
    if the value in cell D7 is between 128 and 256, I want Excel to place a 24 in cell C7
    if the value in cell D8 is between 256 and 512 I want Excel to place a 23 in cell C8
    if the value in cell D9 is between 512 and 1024, I want Excel to place a 22 in cell C9
    if the value in cell D10 is between 1024 and 2048, I want Excel to place a 21 in cell C10

    Any help you can give me would be greatly appreciated.

    Thanks and regards,

    Malcolm.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Enter a number depending on the value of the adjacent cell witjin ranges

    Can you clarify the ranges?
    1 range is missing, and the others overlap each other..

    What about between 16 and 128 ??
    What about less than 8, or greater than 2048 ?

    And say a cell is exactly 256, should that be 24 or 23 ??
    Same for 512 and 1024

  3. #3
    Registered User
    Join Date
    10-17-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Enter a number depending on the value of the adjacent cell witjin ranges

    Hi Jonmo1,

    Thanks for your help !

    I was going to keep it simple and then modify what someone sent me, but as you ask .....

    >=2 and <4 I would want a 30
    >=4 and <8 I would want a 29
    >=8 and <16 I would want a 28
    >=16 and <32 I would want a 27
    >=32 and <64 I would want a 26
    >=64 and <128 I would want a 25
    >=128 and <256 I would want a 24
    >=256 and <512 I would want a 23
    >=512 and <1024 I would want a 22

    Thanks agin,

    Malcolm.

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Enter a number depending on the value of the adjacent cell witjin ranges

    Try this
    =31-INT(LOG(D6,2))
    and copy down

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Enter a number depending on the value of the adjacent cell witjin ranges

    I was going to suggest
    =LOOKUP(D6,{0,2,4,8,16,32,64,128,256,512,1024},{"",30,29,28,27,26,25,24,23,22,""})

    But Jose's is much nicer...

  6. #6
    Registered User
    Join Date
    10-17-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Enter a number depending on the value of the adjacent cell witjin ranges

    Well thank you very much to you both for your kind help.

    I am truly grateful for all the helpful folks on this forum.

    Have a great day.

    Thanks,

    Malcolm.

+ 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] Enter number in blank cell match number on sheet 2 & enter data from adjacent cell
    By Bikeman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-10-2015, 08:36 PM
  2. add value depending if the adjacent cell have any value
    By luis6777 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-12-2015, 03:48 PM
  3. [SOLVED] return value depending of the adjacent cell
    By luis6777 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 12-22-2014, 05:40 PM
  4. [SOLVED] Change adjacent cell depending on text
    By Tubby McChubbles in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-28-2013, 08:25 AM
  5. Sum of rows depending on the adjacent cell
    By cheftt in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-06-2012, 09:50 AM
  6. Replies: 1
    Last Post: 08-04-2011, 06:17 AM
  7. adding non-adjacent cells depending on another cell
    By clayton in forum Excel General
    Replies: 12
    Last Post: 11-30-2006, 12:48 PM

Tags for this Thread

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