[Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register]

Author Message
Entropy
General User

Joined: 09 May 2006
Posts: 8

 Posted: Sat Apr 25, 2009 10:49 am    Post subject: Summing if two conditions match. I'm hoping someone can help me. My brain hurts after hours of trying to figure this out. In simplistic terms I need to create a formula that looks for matches within the same row of two columns and takes the amount of the third column and adds that. To be exact... If column A has shows anything from 10:00 to 10:59 and column B has the text "eurchf" then take the amount in column C and add that for any row meeting the criteria. The rows can span up to 5000. I appreciate the help. Thanks!
Villeroy
Super User

Joined: 04 Oct 2004
Posts: 10065
Location: Germany

 Posted: Sat Apr 25, 2009 11:16 am    Post subject: http://www.oooforum.org/forum/viewtopic.phtml?t=83306_________________Rest in peace, oooforum.org Get help on http://forum.openoffice.org
Entropy
General User

Joined: 09 May 2006
Posts: 8

 Posted: Sat Apr 25, 2009 1:33 pm    Post subject: Thank you, the SUMPRODUCT function was an enormous help. This is what I have so far and it works. =SUMPRODUCT(Raw.C2:Raw.C5000="22";Raw.E2:Raw.E5000="eurchf";Raw.N2:Raw.N5000) However the "22" is really only two characters within the cell such as "2009.04.13 22:00" I'm thinking along the lines of using MID(Raw.B2;12;2), but I'm not sure how to implement it within the first SUMPRODUCT condition. Ultimately it needs to only calculate data from 22:00 to 22:59 hour timestamps, if that makes any suggestions easier. Thanks for the help.
Villeroy
Super User

Joined: 04 Oct 2004
Posts: 10065
Location: Germany

 Posted: Sun Apr 26, 2009 9:19 am    Post subject: HOUR(xxx)=22 I hate fumbling with text values in Calc, but this should work as long as we work under a locale where "HH" means "Hours": TEXT(Raw.B2;"HH")="22" The first numeric approach is unambiguous._________________Rest in peace, oooforum.org Get help on http://forum.openoffice.org
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 8 Hours Page 1 of 1

 Jump to: Select a forum OpenOffice.org Forums----------------Setup and TroubleshootingOpenOffice.org WriterOpenOffice.org CalcOpenOffice.org ImpressOpenOffice.org DrawOpenOffice.org MathOpenOffice.org BaseOpenOffice.org Macros and APIOpenOffice.org Code Snippets Community Forums----------------General DiscussionSite Feedback
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum