Consulting

Results 1 to 8 of 8

Thread: Calculation problem

  1. #1
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location

    Calculation problem

    In the attached WB, in column E, a 1 is entered if the student is a foreign student. This triggers the formula in Column AB to populate that cell with the word Foreign (it defaults to "US"). Now notice the formula in D4 and D5. I need a formula that calculates the same way D4 and D5 do for cells F4 and F5. How can you do the kind of calculation done in D4 and D5 because you cannot divide by a text string? I know you cannot do that but is there a way to do it another way? Thanks
    Peace of mind is found in some of the strangest places.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    =SUMPRODUCT(--($AB$9:$AB$128=$E4),$V$9:$V$128,$F$9:$F$128)

    But I also don't get the formula in V9

    =(COUNTIF(S9:U9, ">0"))+(COUNTIF(S9:U9, "<0"))

    and W9

    =SUM(S9:U9)

    because as far as I can see, T9 and U9 are not numbers.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Me either. Was just asked to make these modifications. So your formual goes in both F4 and F5?
    Peace of mind is found in some of the strangest places.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It goes in F4, and copied down to F5.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Works like a charm. The formula king!!!
    Peace of mind is found in some of the strangest places.

  6. #6
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Hold on, Im not seeing the formula populating the cell with any numbers. Am I missing something here?
    Peace of mind is found in some of the strangest places.

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Because all of those numbers in column V are all zero, which are zero because S is zero.
    Last edited by Bob Phillips; 08-23-2007 at 10:09 AM.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  8. #8
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Peace of mind is found in some of the strangest places.

Posting Permissions

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