sumif formula to calculate values - google-sheets

I have this data set where I am using this formula to calculate the outstanding course fee but when I am putting the amount received its not deducting the remaining amount from the total course fee and showing in the next record. I am not able to work this out with sumif formula, any help will be highly appreciated.
=IF(AND(ISBLANK(A5)),"",VLOOKUP(A5,Student_Registration!$B$5:$H$2000,7,0)-SUMIF($A$5,A5,$I$5))
Sample worksheet : https://docs.google.com/spreadsheets/d/1roEXEuBBwHU8lKV_QruY6hVjYOOkpwAwAI5x8yuYfZ8/edit?usp=sharing

Since your Column G and Column I already have value to be used, why don't you use the following simplified formula to obtain the expected outcome?
What you need is to used to formula to populate the value in Column I, hope it will help.
=G5-SUMIF($A$5:A5,A5,$I$5:I5)

Related

Trying to only SUM values in one column based on if the adjacent cells in another column contain a formula

So I'm creating a Google Sheets doc that contains my hours and overtime for an hourly position I have, and how much overtime I'll need to make the amount of money I need to make to survive.
In addition to this I am also trying to track my hours so I can track the actual amount of money I'm making.
So I have a projected clock out time in Column B that uses a formula to tell me what time I need to ideally clock out at based on how many hours I need and what time I clocked in at. When I clock out, I enter the actual time I clocked out at.
In Column C I have the total amount of hours I worked that day, formatted in duration based on the difference between the value in Column A and Column B. If I haven't entered in a value in Column B, it shows me the ideal amount of hours I need that day.
I want to calculate my actual hours worked per week as I'm working that week, so I need to ONLY sum the values in Column C if the adjacent value in Column B is NOT a formula. So I need it to sum the values in column C if I've entered the actual time that I clocked out at in column B.
I've looked up this question and tried multiple solutions I've found here, even tried troubleshooting with ChatGPT, but most are just trying to sum the range that contains the values/formula, and not summing a different column based on if another column has formulas or not.
There seems to be a lot of posts that come super close but don't seem to work for how I need this to work.
Edit: Here is the example sheet.
So F3:F6 are values that have been manually entered, while F:7 has been calculated by a formula.
I need H9 to sum the values of H3:H7, but only the values adjacent to the times in the F column that have been manually entered. In this example, I need it to sum H3:H6 and ignore H7 until I enter a time and remove the formula in F7.
try:
=SUMPRODUCT(MAP(F3:F7,LAMBDA(z,IFNA(FORMULATEXT(z),1))),H3:H7)
You may filter and check if there is a formula with FORMULATEXT. If there isn't it will throw a #N/A error. Then with ISNA it will keep the values in which its adjacents did'nt have a formula:
=SUM(FILTER(C:C,BYROW(B:B,LAMBDA(b,ISNA(FORMULATEXT(o))))))

GOOGLEFINANCE Formulas in arrays for Google Sheets

I have a product with In-App Purchases in several markets in which transactions happen in their local currency. Created a Google Sheet for the purpose of reporting revenues in our base currency (USD). I tried several things to create the most effective method to automatically read the currency pair for each transaction, but the formula isn't working.
I am attempting to accomplish 3 things here:
Create an array that will automatically convert different currencies to USD by using the GOOGLEFINANCE formula (see "G1" on the embedded spreadsheet).
Eliminating error when conversion finds a value having the same ISO codes (see "F12" on the embedded spreadsheet).
Calculating the transaction using the exchange rate of the day of the transaction instead of TODAY's exchange rate (no clue on how to do this without breaking the GOOGLEFINANCE formula).
Here is the formula I am using on Col "G" is:
={"CONVERSION ARRAY";ARRAYFORMULA(E2:E*GOOGLEFINANCE("CURRENCY:"&D2:D))}
The problem with this approach is that it replicates the value of cell "D2" down the whole array, instead of consecutive values from D2,3,4, etc, accordingly. Removing the "&" from the array breaks the formula.
While the formula used on Col "F" =E2*GOOGLEFINANCE("CURRENCY:"&D2) works, the problem here is that it has to be placed manually, row by row, and this is inefficient when dealing with thousands of records. Also, you will notice on cel F12, I get an invalid value because GoogleFinance cannot convert from dollars to dollars. The formula outputs an error. Is there a way to make the formula understand that when trying to convert a value with the same currency ISO's, the value stays the same?
Even while I get the correct calculation on approach #2, the data calculated is based on TODAY's exchange rate, however, I need that calculation based on the exchange rate of the same date of the transaction. Is this even possible?
The referred spreadsheet example is here: Google Finances Conversion Formula
GOOGLEFINANCE is not supported under ARRAYFORMULA
if your D2:D range is small you can do:
={"CONVERSION ARRAY";ARRAYFORMULA(E2:E5*{
GOOGLEFINANCE("CURRENCY:"&D2);
GOOGLEFINANCE("CURRENCY:"&D3);
GOOGLEFINANCE("CURRENCY:"&D4);
GOOGLEFINANCE("CURRENCY:"&D5)})}

Using =GetPivotData in GoogleSheet to get specific Grand Total

I'm trying to use =GetPivotData formula to dynamically pull specific sum totals (40% & 80% Sell-Out Probability in my example) into a table. I may not fully understand how to use the formula, but everything I've tried has returned an error.
Sample Sheet
This formula seems to pull the answer you want, if I understand your question.
=GETPIVOTDATA("SUM of Sales",H2,"Sell-Out Probability","40%")
This would go in N8 of your sample sheet.
N9 would have the same formula, but with "80%" as the last value.
Let me know if this helps.

How can I multiply together every nth cell in a row to get the product?

I want to calculate the product of the investment returns (compound interest), which in this instance would give a return of 162%:
Additional stock return data will be added in future, so I need a formula that compounds every nth (2nd) value. I am able to sum the cells using:
=SUMIF(ARRAYFORMULA(MOD((COLUMN(A2:H2)-COLUMN(A2)+1),2)),0,A2:H2)
However I cannot find an equivalent 'PRODUCTIF' function and have not been able to make a formula that works. Writing the formula out long hand would be:
=B2*D2*F2*H2
Product formula should be like Sum formula but putting 1 for odd columns:
=ArrayFormula(PRODUCT(IF(MOD(COLUMN(A2:H2)-COLUMN(A2)+1,2),1,A2:H2)))
I guess i'm a little confused. doesn't PRODUCT() just ignore text?
Doesn't =PRODUCT(2:2) work?
You can also use the following formula:
=PRODUCT(TRANSPOSE(2:2))
and format the result as Percent from the menu
Functions used:
TRANSPOSE
PRODUCT
EDIT
As correctly noted by Mat, an even simpler formula can also give the correct results.
=PRODUCT(2:2)

Google Sheets: Add value to total if a row condition matches for infinite column

I am attempting to make a Google Sheet that has a column for a rate and a value of that rate. Each night I am adding a new value to the bottom of this list so I want it to continue as an infinite list. What this sheet should do is look down the list of rates, if the rate matches a predefined rate, it should add the corresponding value to the total for that rate. I have four common rates that occur in no particular order and with some given value. I would like to total the values for each of those rates and give them in the totals section so each rate can be easily referenced.
Is there a way to do this using Google Sheets built-in commands? Pseudocode would be something like IF(A2:A = rate, add value in B to total). I know to make an infinite reading of a column by A2:A, but I don't know how to check each value as it goes through that column. I have attached a test spreadsheet with some sample values and the output that should be given by the formula. Thank you in advance for your help.
https://docs.google.com/spreadsheets/d/19k1DMipSsI9tWSjTXrVAPzPoaenWS6WYmlwe201_WQk/edit?usp=sharing
I managed to discover my own answer using the SUMIF statement. My code for the rate of .75 is ""=SUMIF(A2:A,"=.75",B2:B)"". I ran into some more trouble with the section for a different rate because I was having trouble saying not equal to .75 or 1 or 1.5 or 1.75. I solved this problem by completely bypassing it and adding the all the values and subtracting away the values already added. I would still like to know how to give the list of "ors" if someone could shed some light on this. But I now have a working solution regardless. I have updated the test sheet to show the solution.

Resources