+ Reply to Thread
Results 1 to 3 of 3

Conditional sorting

  1. #1
    Registered User
    Join Date
    09-21-2007
    Posts
    2

    Conditional sorting

    Column a ---Columnb--Columnc--Columnd
    WeekDay----Data1----Data2----Data3
    Sunday------315------misc-----misc
    Monday------260-----misc------misc
    Tuesday-----1972----misc------misc
    Wednesday--2400----misc------misc
    Thursday----2366----misc------misc
    Friday-------2129----misc------misc
    Saturday----626-----misc------misc
    Sunday-----416------misc------misc
    Monday-----2680----misc------misc
    Tuesday----2634-----misc------misc
    Wednesday--2635----misc-----misc
    Thursday----2480----misc-----misc
    Friday-------2268----misc-----misc
    Saturday----588-----misc-----misc
    Sunday------369----misc------misc
    Monday------2386---misc------misc


    I have the above in one sheet. What I want to do is on another sheet is to have it sort "data1" in the following format:

    Column a--------Columnb-Columnc-Columnd
    Weekday--------Week 1--Week 2--Week 3
    Sunday----------315-----416------369
    Monday----------260-----2680-----2386
    Tuesday---------1972----2634
    Wednesday------2400----2635
    Thursday--------2366----2480
    Friday-----------2129----2268
    Saturday--------626------588


    Is it possible to do with a function, or do I have to come up with a VB script to take care of it? I have a lot of tags setup to show week number, day number, month number, etc, because I'm doing some sumif's on another page, but I can't seem to get this going the way I want it, so any help would be greatly appreciated.

    Thanks!
    Steph S.

  2. #2
    Valued Forum Contributor
    Join Date
    04-11-2006
    Posts
    407
    =SUMPRODUCT(--($A$2:$A$17=$A20),--($B$2:$B$17=VALUE(MID(C$19,5,LEN(C$19)-4)))*$C$2:$C$17)

    See attachment. Hope that helps.

    -Ik
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-21-2007
    Posts
    2
    that works great, thanks! It did take me a bit of time to figure out why it wasn't working for me at first however; it kept returning a #VALUE! error, but then I realized it was because my ranges included days where there were no values (IE - future dates). This is also why some of the things I had tried earlier weren't working either. Any work arounds you might have for this? I would just populate the range with Zero's, but then it has an adverse affect on another report I have going .

+ 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