+ Reply to Thread
Results 1 to 6 of 6

Relating text to a value

  1. #1
    SociologyStudent
    Guest

    Relating text to a value

    Can I relate text to a number so I can sum a string of text? I'm trying to
    create a work schedule and ensure each employee is working 32.00 hours per
    week.
    Example:
    F12 G12 H12 I12 J12 K12 L12 M12
    Katrina Harris X X D D D/E D X (sum of F12:L12)

    X = off or 0.00
    D/E = 15
    D = 7.5

    M12 should equal 37.5




  2. #2
    Peo Sjoblom
    Guest

    Re: Relating text to a value

    D+D+D is 45 + 7.5 is 52.5 not 37.5
    to me it looks like the values in F12:L12 are

    X, X, D, D, D/E, D, X

    not so?

    anyway this will work

    =SUMPRODUCT(COUNTIF(F12:L12,{"X";"D";"D/E"}),{0;15;7.5})

    --

    Regards,

    Peo Sjoblom

    http://nwexcelsolutions.com


    "SociologyStudent" <[email protected]> wrote in
    message news:[email protected]...
    > Can I relate text to a number so I can sum a string of text? I'm trying to
    > create a work schedule and ensure each employee is working 32.00 hours per
    > week.
    > Example:
    > F12 G12 H12 I12 J12 K12 L12 M12
    > Katrina Harris X X D D D/E D X (sum of
    > F12:L12)
    >
    > X = off or 0.00
    > D/E = 15
    > D = 7.5
    >
    > M12 should equal 37.5
    >
    >
    >




  3. #3
    Barb Reinhardt
    Guest

    RE: Relating text to a value

    Try

    =COUNTIF(F12:L12,"X")*0+COUNTIF(F12:L12,"D")*7.5+COUNTIF(F12:L12,"D/E")*15

    The first part really isn't needed, but if you want to change the X to be
    something besides 0, you can just change the 0 value.

    "SociologyStudent" wrote:

    > Can I relate text to a number so I can sum a string of text? I'm trying to
    > create a work schedule and ensure each employee is working 32.00 hours per
    > week.
    > Example:
    > F12 G12 H12 I12 J12 K12 L12 M12
    > Katrina Harris X X D D D/E D X (sum of F12:L12)
    >
    > X = off or 0.00
    > D/E = 15
    > D = 7.5
    >
    > M12 should equal 37.5
    >
    >
    >


  4. #4
    Brian Taylor
    Guest

    Re: Relating text to a value

    =COUNTIF(F12:L12,"D")*7.5+COUNTIF(F12:L12,"D/E")*15


  5. #5
    Brian Taylor
    Guest

    Re: Relating text to a value

    Peo,

    D = 7.5 and D/E = 15. I think you got it backwards. But I like your
    formula. Pretty slick: a sumproduct, countif, and two arrays. You are
    my hero.


  6. #6
    SociologyStudent
    Guest

    Re: Relating text to a value

    You are correct Mr. Taylor. Thank you for clarifying for me. You all were
    very helpful. Thanks!

    "Brian Taylor" wrote:

    > Peo,
    >
    > D = 7.5 and D/E = 15. I think you got it backwards. But I like your
    > formula. Pretty slick: a sumproduct, countif, and two arrays. You are
    > my hero.
    >
    >


+ 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