Results 1 to 6 of 6

Thread: Need some Excel/VB Help. Please!

  1. #1
    Maximum Bitrate CJ8501's Avatar
    Join Date
    Jul 2004
    Location
    Orland Park, IL
    Posts
    660

    Need some Excel/VB Help. Please!

    Quick backround: I'm a freshmen at UoI taking CS105 (Intro to CS) and cant figure out this code for anything. Ive been sitting here trying tons of different combinations and its so simple, but I cant seem to get it. This is basic stuff here. Pretty much, heres what I need to do.
    Calculate the Discount (8 points)

    Enter a formula in cell B27 to calculate and display the discount that applies. A discount is not always applicable. If the projected number of customers for the entered class is less than the average number of customers for that class over the last 4 years, then the Special Discount is applicable and you should store the discount given in cell G19 in cell B27. Otherwise, the trip is not eligible for the discount and you should store 0 in cell B27. Confusing, huh? Let's take this a step at a time...

    1.

    Start by entering a formula in B27 that calculates the discount to be applied for the Premier Class. Your formula should not use the actual values in cells B17 and B18 but should instead refer to those cells. If the Class Num entered in cell B23 equals 1 and the projected value in cell B18 is less than the average value in cell B17 then the formula should return the discount value in cell G19, otherwise it should return 0.
    2.

    At this point, if either of the first pair of conditions is not met the formula returns 0. Instead what it should really do is to check if similar conditions are met for any of the other classes.
    3.

    Replace the 0 in the IF function, with another IF function that checks if the class num entered in cell B23 equals 2 and the projected value in cell C18 is less than the average value in cell C17. If both these conditions are satisfied, the nested IF should return the discount value in cell G19, otherwise it should return 0 (you might find it helpful to write this part in another cell first and copy the results to your original formula once you are sure it works correctly.).
    4.

    At this point, we are checking conditions for the first two classes of travel. Extend the formula further to handle all three classes of travel.



    XLS File
    https://netfiles.uiuc.edu/cmurzan2/s...ls?uniq=yll3ef


    Like I said, any help would be so greatly appreciated.

  2. #2
    Maximum Bitrate CJ8501's Avatar
    Join Date
    Jul 2004
    Location
    Orland Park, IL
    Posts
    660
    Cmon no one?

  3. #3
    My man uses Levitra. Peoples's Avatar
    Join Date
    Dec 2004
    Location
    Maryland
    Posts
    2,024
    **** that, figure it out for yourself. I'm sick of people like you passing work off to other people.......and then pass it off as your own
    PC Components:
    Lilliput; XPC/FLEX mobo; 1.7 ghz P4 Mobile;512 DDR; 160 gb HDD; opus 150; slot usb dvd-rw
    My work log

  4. #4
    Neither darque nor pervert DarquePervert's Avatar
    Join Date
    Apr 2004
    Location
    Elsewhere
    Posts
    13,949

    I don't do my daughter's homework for her, I damn sure ain't gonna do yours.
    Have you looked in the FAQ yet?
    How about the Wiki?



    Under normal circumstances, a signature would go here.

  5. #5
    FLAC ukchris's Avatar
    Join Date
    Nov 2003
    Location
    Massachusetts
    Posts
    1,458
    I don't know if I'm reading the question correctly but (2) is going to be something like:

    =IF(AND(B23=1,(OR(B18<B17,C18<C17,D18<D17))),G19,0 )

  6. #6
    Maximum Bitrate CJ8501's Avatar
    Join Date
    Jul 2004
    Location
    Orland Park, IL
    Posts
    660
    Quote Originally Posted by Peoples
    **** that, figure it out for yourself. I'm sick of people like you passing work off to other people.......and then pass it off as your own

    I wasnt asking anyone to do my damn hw for me...... All I asked was some advice like if I should write an IF(AND( statement or some kind of a VBA Code. And this was one small statement, which is a small fraction to the entire project I had to complete. I needed some assistance with programming and thought what better place than a car computer forum. Well, this is the last time I ask anyone on here a ******* question, God forbid. I didnt ask you to do my entire ******* project now did I? Kind of sucks when your left alone to do a entire project assisgned for people in groups of 3.

    Thanks UKchris, I figured it out about an hour after posting the second message. I wrote it correctly but put "&" instead of "And(..." which concatenated my statement which I didnt want.

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
  •