How to find the sum based on two variables
Hello!
I have just started using Numbers, I have a spreadsheet which lists a number of transactions.
On my chart I have Columns "Date", "Memo", "Type", and "Amount".
The Type column is a drop down list. What I want to do and find the sum for transactions that fall between a date range (i.e. months 1-3) and that match a certain "Type". I can figure out how to use the sumif function to find the sum for a date range, however I cant figure out how then to only sum only those that match a type.
Any help?
Brendon,
This question arises from time to time in different situations. The answer is to first create an auxiliary column which calculates whether or not your multiple conditions have been met. In this case you have three - more than or equal a start date, less than or equal an end date, and a "Type".
I'm assuming that your dates and "type" are flexible, so an extra table to enter your search data is shown below, but these three cells could be incorporated in your main table. The formula for the auxiliary column is:
=IF(AND(Date>=Search Range :: A$2,Date<=Search Range :: B$2,Type=Search Range :: C$2),"SUM","")
All rows with the word "SUM" satisfy the three conditions. The footer row contains the sum of the values meeting the desired conditions using:
=SUMIF(Aux, “SUM”, Amount)
Obviously this has to be reworked to your situation, but the auxiliary column is the key.
pw
Message was edited by: pw1840
Similar Messages
-
How to find the Sum based on Like Dates
Hello everyone,
Column 1 contains "Date Sent", Column 2 contains "Dates of Service" and Column 3 contains the payment "Amount" in USD. I want to write a formula that will total up the sum of payment values from column 3 based on the date of payment (Column 1).
Thanks!
JaredHi Jared,
This will do what's illustrated in your example, but has a few restrictions:
The dates must run in ascending order.
To get a total for the last date, a later date (with no corresponding amount) must be entered after the last transaction.
Formula:
Entered in D2, and filled down the rest of column D:
=IFERROR(IF(A3>A2,SUMIF($A,A2,C),""),"")
IFERROR is used to suppress the error message that arises from the formula in D10 referencing a cell in D11.
Regards,
Barry -
How to find the structural difference between two tables
Hi all,
How to find the structural difference between two tables .
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
Thanks,
P Prakashyou could try something similar to this, for each table pair that you want to compare:
SELECT 'TABLE_A has these columns that are not in TABLE_B', DIFF.*
FROM (
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_A'
MINUS
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_B'
) DIFF
UNION
SELECT 'TABLE_B has these columns that are not in TABLE_A', DIFF.*
FROM (
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_B'
MINUS
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_A'
) DIFF;that's assuming, column_name, data_type and data_length are all you want to compare on. -
Adobe forms: How to reduce the spacing dynamically between two variables
Hi All,
I have a requirement where at the header I am printing the address and below that other contact detials of vendor. I have used standard address element of adobe forms and printing it on the form using a variable.
When my addres contains 3 lines only in that case other contact details which are below address varible should dynamically move up.
BRADKEN RESOURCES P/L
86 BYNG STREET
ORANGE NSW 2800
Tel 123456789
How can reduce the above spacing bet two variable. Please help me in getting the solution for this issue.
Many thanks in advance!
VikashHi
You can concatenate the 2 variable and display it on that field.
data.Page1.<field>.rawValue = Concat(data.Page1.<field1>.rawValue , "\u000a" , data.Page1.<field2>.rawValue)
Kind Regards
Mukesh -
How to find the sum of a column
I need to find the sum of a column and use it in a different column. The following is the example.
Column names: Feedback(Good, Avg, Poor), Count(no of good, no of avg, no of poor) and %age(Feedback/sum(feedback))
I want to find the sum in Java class and also calculate the last column in java class.
Please tell me some way to do it.oh.. ok ..thanks for letting me know.. i will formulate the question in a proper way:
This is what my UI should look like:
Rating Count Percent
Excellent 2 20
Good 6 60
Poor 1 10
Bad 1 10
Now i have the following columns in the data base:
Meaning and feedback_rating.
So the following SQL Query:
SELECT hrl.meaning rating,
sum(decode(bcpi.feedback_rating, null, 0, 1)) counted
from cmp_cwb_person_info bcpi ,
hr_lookups hrl
group by hrl.meaning
will give me the result as
rating counted
Excellent 2
Good 6
Poor 1
Bad 1
Now I want a third column as percentage : Earlier we were doing this calculation in the sql query itself, so the query was like
SELECT hrl.meaning rating,
sum(decode(bcpi.feedback_rating, null, 0, 1)) counted,
sum(decode(bcpi.feedback_rating, null, 0, 1))/(max (select count (*) from cmp_cwb_person_info bcpi ,
hr_lookups hrl )) percent
from cmp_cwb_person_info bcpi ,
hr_lookups hrl
group by hrl.meaning
Hence the third column (percent) was calculated in the sql query itself.
But now i feel that the performance of the query could be improved if we get the first two columns from the database and the calculate the third column programatically in the java code.
So this is what I want to know. How can i do that? -
How to find the material based on the division.
Hi All,
My requirement is to read the all the material(products) in the division.
I have executed transaction code:COMMPR01 and seen division field in material tab.
I found the table CRMC_DIVISION but i did not find any maetial.
Please help me how to find the PRODUCT in the division.
Thanks,
VenkatHi Venkat,
There are three tables that you need to refer to get the products for a particular division in CRM.
1. Go to table COMM_PRMAT, pass the division and get the Set Guid for all the products
2. Go to table COMM_PR_FRG_REL, pass the Set Guid and get the Product Guid of all the products.
3. Go to table COMM_PRODUCT , pass the product guid and get the list of product ID which belongs to that particular division.
I hope this will help you.
Regards,
PP -
How to find the phase difference between two signals using Hilbert transform
hi,
I am new to LabView.... I am trying to find phase difference between two signals. I sucessfuly found out the phase difference between two predefined waves using single tone measurement. .... But I really want to know how can I measure phase difference between two signals( not predefined... ie we don't know the initial conditions) using hilbert transform or any transformation techniques (without using zero cross detection).. I tried by using hilbert transform based on algorithm... bt I am getting error.... plz help me
Attachments:
phase_differece.vi 66 KByou could try something similar to this, for each table pair that you want to compare:
SELECT 'TABLE_A has these columns that are not in TABLE_B', DIFF.*
FROM (
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_A'
MINUS
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_B'
) DIFF
UNION
SELECT 'TABLE_B has these columns that are not in TABLE_A', DIFF.*
FROM (
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_B'
MINUS
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_A'
) DIFF;that's assuming, column_name, data_type and data_length are all you want to compare on. -
How to find the sum of an advanced table column?
Hi All,
Good Morning..
I have requirement where i need to calculate the sum of a column in an advanced table.and i need to put that value into some other field.
i am doing customization so i can't touch the Standard page properties.so i need to achieve it through Pro-grammatically..
my column name is unit price in the advanced table region.so i need the code to calculate the sum of the unit price.
Thanks in advance
BharatHi Bharat,
No need for Programatic way as Advanced Table already provides this facility.
The following steps describe how to enable Totaling for a column in the footer of an advanced table.
Step 1: In the Structure pane of OA Extension, select the column container for which you want to enable Totaling Any column except for the first column can be totaled. Set the Total Value property for this column container to True.
Step 2: In the Structure pane, select your advancedTable region and choose New > footer from the context menu. OA Extension creates an advancedTables Components folder containing a footer named child, that contains a tablefooter container (labeled tableFooter1).
Step 3: Select the tableFooter container and choose New > total from the context menu. OA Extension creates a tableFooter Components folder containing a total named child, that contains a new totalRow item as shown in the figure below.
Please let me know if you are still unable to get the Total Column
HTH,
Regards,
Syed. -
How to find the queries based on the hierarchy
Hi experts,
Many queries are using one hierarchy.now I want to know which queries are using this hierarchy. How to make it? Thank you.
Best regards,
GavinUnder this object check where used list. Then you should get the list of queries where this hierarchy is used.
Regards
Rohini -
How to find the linkname based on its ractangle?- indesign cs2- js?
i selected the rectangle , which holding one image init, i cant able to get the image name, how to solve this in indesign cs2?
-thanks
subhamyRect.graphics[0].itemLink.name;
-
How to find the time difference..?
HI
How to find the time difference between two times
for Example
the difference between '24/10/2005 8:25:00 PM' and '25/10/2005 5:20:00 AM'
is 8.55
KrisThis is a procedure taht do the job
CREATE OR REPLACE FUNCTION Diff_Time
LD$Date_Deb IN DATE DEFAULT SYSDATE
,LD$Date_Fin IN DATE DEFAULT SYSDATE
,LN$JJ OUT PLS_INTEGER
,LN$HH OUT PLS_INTEGER
,LN$MI OUT PLS_INTEGER
,LN$SS OUT PLS_INTEGER
) RETURN NUMBER
IS
dif NUMBER ;
BEGIN
IF LD$Date_Fin < LD$Date_Deb THEN
RETURN ( -1 ) ;
END IF ;
SELECT LD$Date_Fin - LD$Date_Deb INTO dif FROM dual ;
SELECT TRUNC ( LD$Date_Fin - LD$Date_Deb) INTO LN$JJ FROM dual ;
SELECT TRUNC ( (LD$Date_Fin - LD$Date_Deb) * 24) - ( LN$JJ * 24 ) INTO LN$HH FROM dual ;
SELECT TRUNC ( (LD$Date_Fin - LD$Date_Deb) * 1440) - ( (LN$HH * 60) + ( LN$JJ * 1440) ) INTO LN$MI FROM dual ;
SELECT TRUNC ( (LD$Date_Fin - LD$Date_Deb) * 86400) - ( (LN$MI * 60) + (LN$HH * 3600) + ( LN$JJ * 3600 * 24 ) ) INTO LN$SS FROM dual ;
RETURN( dif ) ;
END ;
/You may have to modify it to fit your own requirement.
Francois -
How to find the avg salary of first 3 employees based on each department?
how to find the avg salary of first 3 employees based on each department?
Hi,
Do you mean something like this?
with a as
select
deptno
,sal
,row_number() over ( partition by deptno order by sal desc) rn
from
emp
select
deptno
,round(avg(sal)) avg_sal_of_top_3
from
a
where
rn <= 3
group by
deptno
order by
deptno
DEPTNO AVG_SAL_OF_TOP_3
10 2917
20 2992
30 1983
If not please give more details.
Regards,
Peter -
How to find the difference in object definition between two databases
Hi,
Can any one suggest me how to find the difference in object definition between two different databases. Is there any tool or by OEM? If so how?
Regards
Naveenthis link may be helpful...
http://www.dbspecialists.com/scripts.html -
How to find the application type fora Script based on Form name?
Hi Guys,
can anybody tell me how to find the Application Type and output type based on Form name and print program name?
I am having form name as: ZINVENT (INVENT is the actual) and program name as RM07IDRU.How can i find the Appliction ntype and OutType for entering into the NACE tr code.
i tried thru TNAPR table but i was not able to find the Entry in the TNAPR with form Name and printprogram name
Th Script is about Phsical inventory Documents.
Thanks,
Gopi.You can use this...
REPORT Z_DUMMY_ATG NO STANDARD PAGE HEADING.
*======================================================================
* Tablas
*======================================================================
TABLES: TTXFP.
*======================================================================
* Tablas Internas
*======================================================================
DATA: T_TTXFP TYPE STANDARD TABLE OF TTXFP WITH HEADER LINE.
*======================================================================
* Selection-Screen
*======================================================================
SELECTION-SCREEN BEGIN OF BLOCK SCRIPT WITH FRAME.
SELECT-OPTIONS:
PRINTNAM FOR TTXFP-PRINT_NAME,
TDFORM FOR TTXFP-TDFORM.
SELECTION-SCREEN END OF BLOCK SCRIPT.
*======================================================================
* Start-of-selection
*======================================================================
START-OF-SELECTION.
PERFORM SELECT_DATA.
PERFORM PRINT_DATA.
*& Form SELECT_DATA
* Seleccionamos los datos del reporte.
FORM SELECT_DATA.
SELECT TDFORM PRINT_NAME LAST_PROG
INTO TABLE T_TTXFP
FROM TTXFP
WHERE PRINT_NAME IN PRINTNAM
AND TDFORM IN TDFORM
ORDER BY TDFORM.
ENDFORM. "SELECT_DATA
*& Form PRINT_DATA
* Imprimimos el resultado del reporte.
FORM PRINT_DATA.
FORMAT COLOR 3.
WRITE: 'Programa', 18 'Formulario', 50 'Flag de Ultimo programa'.
FORMAT COLOR OFF.
SKIP 1.
IF NOT T_TTXFP[] IS INITIAL.
SORT T_TTXFP BY PRINT_NAME.
LOOP AT T_TTXFP.
IF T_TTXFP-LAST_PROG EQ 'X'.
FORMAT COLOR 4.
WRITE:/ T_TTXFP-PRINT_NAME, 18 T_TTXFP-TDFORM, 60 T_TTXFP-LAST_PROG.
FORMAT COLOR OFF.
ELSE.
WRITE:/ T_TTXFP-PRINT_NAME, 18 T_TTXFP-TDFORM, 60 T_TTXFP-LAST_PROG.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. "PRINT_DATA
Greetings,
Blag. -
Used to be able to pick out which songs in iTunes in my computer were not on a 2nd computer on homeshare in iTunes 10. Now with V11, cant find the button that compares two libraries and finds the songs that are different. Anyone know how to do this now?
Jneklason wrote:
~snip~
I know this email is confusing and really hard to understand...perhaps now you will know how i've been feeling--lost and confused with all the mis-information, with a hit and miss phone, and out of time with all the 1 1/2 hr to 2 hrs EACH wasted on this issue.
On top of all this, I can't even find out how to file a complaint with anyone higher up than Customer Service.
I hate to tell you this, but you didn't write an email. You wrote a discussion post on the Verizon Wireless Community forum which is a public peer to peer forum. Unfortunately since you didn't mark your post as a question, the VZW reps that roam this community won't ever see your post. Before you re-post it, don't. Duplicate posts get removed from the community.
I see there were several missteps both by the reps and yourself in your post. First you should have insisted on returning the phone within the 14 day return policy period. Second which Samsung Galaxy mini model did you purchase? The S3 mini or the S4 mini? Did you do any research prior to deciding on this device. The reps at that time deflected the easiest course of action, by trying to get you to replace the phone under insurance instead of returning the phone. The Early Edge payment option requires the current phone on the line using the early Edge must be returned to Verizon Wireless. Did you once considered going to a third party site like Swappa to purchase a gently used device for your daughter?
Maybe you are looking for
-
Is there a way to completely undo all flex time mods to an audio file?
I have an audio drum track that i thoroughly destroyed messing around with flex time and audio quantizing. I believe these are nondestructive edits, but i can't find anyway to get it totally back to its original state. Is this possible? Thanks
-
Batching outbound transactions
I have a business requirement to correlate and batch outbound responses with inbound transactions. I receive inbound files from various customers that contain a set of documents I need to construct the outbound file with responses to the same set of
-
Hello everyone, I have a problem with my 5000d-2, when somebody calls me, the phone displays only the phone number of the person that's calling me, although I have that person in my contact list (phone memory not sim). Can somebody guide me trough th
-
Hi. I'm trying to use opera (9.25-2) with flashplugin (9.0.115.0-2). Doesn't seem to work at all. It just loads a white frame - on mouseover it says "click to activate and use this control". Got any clue? Any version of flashplugin that supports 9.25
-
IPod updater-good or bad?
Hello I have read that some people, when they downloaded the updater, gave their ipod trouble....did it happen oanyone? and second: when you download it, you put in my documents, but then how does it get in your ipod? Chris