+ Reply to Thread
Results 1 to 9 of 9

Limit values following a list

Hybrid View

  1. #1
    Registered User
    Join Date
    11-03-2010
    Location
    Brussels, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    5

    Limit values following a list

    Hello,
    I have a list of towns column A. A list of prices (5 per town) in column B. For the five prices of each town I have a maximum value and a minumum value. The list of max values is in column c and the list of min values is in column d.
    I would like the prices to remain the same when they fall between the min and max value (in column e), or change to the max when the price is highet and to the min when the price is lower.

    Please see file attached if not clear.

    Thank you very much for helping!!!!!
    Attached Files Attached Files
    Last edited by Ritzo; 12-06-2010 at 04:47 AM.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Limit values following a list

    Column E is empty. What exactly do you expect to happen?

    BTW, the issue could have easily been illustrated with 50 rows of data and a file size of 15 KB instead of 1400 rows with a file size of 150 KB.

  3. #3
    Registered User
    Join Date
    11-22-2010
    Location
    Finland
    MS-Off Ver
    Excel 2003, 2007
    Posts
    95

    Re: Limit values following a list

    It would've been easier to copy the formulas if you had those mins and maxs in every row. Anyway I believe what you are looking for is like this:

    =IF(B6<C6;B6;0)*IF(B6>D6;1;0)+IF(B6>C6;C6;0)+IF(B6<D6;D6;0)

    Put that into E6 and copy with min and max locks upwards. Though as I previously said I would try to indicate mins and maxs in every row.

    Of course you could build a macro for that - especially since you put this into programming section - but I really don't see the point of that.
    Last edited by KiPA; 11-24-2010 at 06:29 AM.
    An example file is never useless!

    Tried an example function of mine and got errors?
    - Had you found them, replace ; with , and , with .

  4. #4
    Registered User
    Join Date
    11-03-2010
    Location
    Brussels, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Limit values following a list

    Sorry for my mistakes it is my second post and the first one has been deleted. sorry.

    Here should be a smaller file with the example of the result I would like in column E raws from 2 to 6.
    May be it is more clear? I hope so...thank you!!!!!!

  5. #5
    Registered User
    Join Date
    11-03-2010
    Location
    Brussels, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Limit values following a list

    Forgot the attachement :-(
    Attached Files Attached Files

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Limit values following a list

    I think this will do for Aarhus:

    =MIN(MAX($B2;$D$6);$C$6)

    for Aberdeen

    =MIN(MAX($B7;$D$11);$C$11)

    etc...
    Last edited by snb; 11-24-2010 at 07:06 AM.



  7. #7
    Registered User
    Join Date
    11-22-2010
    Location
    Finland
    MS-Off Ver
    Excel 2003, 2007
    Posts
    95

    Re: Limit values following a list

    So the only problem is how to lock the mins and maxs into 5 row categories? I'd probably take couple of accessory cols along with the main formula. Like:

    =IF(C2=0;(IF(C2<>0;0;C2)+IF(C2<>0;0;C3)+IF(C2<>0;0;C4)+IF(C2<>0;0;C5)+IF(C2<>0;0;C6));0)+IF(C2<>0;C2;0)

    Put that into F2 and copy into G2 and copy them all the way down. Then change the formula in E column to get reference from F and G columns and take the row locks off.

    Edit: I was just wondering why that ^ looks sooo too hard. Then it hit me: you can put "=SUM(C2:C6)" into F2 and copy etc and it works as fine... Also there was one if too much in the original line.
    Last edited by KiPA; 11-24-2010 at 03:32 PM.

  8. #8
    Registered User
    Join Date
    11-03-2010
    Location
    Brussels, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Limit values following a list

    Done! it works. I then added another formula in column H.

    Thank you KiPA
    p.s. should I do something to say the thread is solved?...

  9. #9
    Registered User
    Join Date
    11-22-2010
    Location
    Finland
    MS-Off Ver
    Excel 2003, 2007
    Posts
    95

    Thumbs up Re: Limit values following a list

    Hit the edit button in your thread open and go advanced. Change the title prefix into solved.

+ 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