Excel Concatenate and IF Functions - excel-2010

I need to combine these cells (columns) A and B if the Column C is "Dry" and "Water" and if the carrier is "Maersk" and "Lloyd". Thank you in advance!
Sample data from Excel File:

To me, it sounds like you need to write a basic Excel formula to check that the values of the target columns fall in the allowable ranges. This will require using a combination of the AND and OR functions. Something like this...
Formula for Cell E1:
=IF(AND(OR(C1="WATER",C1="DRY"),OR(D1="Maersk",D1="Lloyd")),A1&B1,"-")

Related

Concatenate Use in Google Sheets (Not in MS-Excel)

I'd like to ask about how to use concatenation formula in Google Sheets (Not in MS-Excel). In Specific, I'd like to Combine Multiple values in Columns to a single value in 1 row. Please let me know your thoughts and suggestions.
Thanks in Advance mates,
Manoj
depends...
you can mostly use just &
=A1&B1
=INDEX(A1:A5&B1:B5&C1:C5)
if you need something advanced try query smash
=QUERY(A:D;; 9^9) << this will collapse all rows of each column into one row
for more about query smash see: https://stackoverflow.com/a/65435321/5632629

Spreadsheet - I want to append data from one sheet to another, they only have one column that can be used as a reference

I have two sheets that only have one column in common - ID column.
I'd like to compare those two columns and if id's match, to append data into Sheet 1 from the matching row.
I don't know if I'm clear enough so here is what I'm trying to achieve:
I've tried looking for any solution, but it's a bit too specific.
Hopefully someone here can explain how can I achieve this?
If you want an one formula solution then use this in cell D2 of Sheet1:
=arrayformula({iferror(vlookup(A2:A, {Sheet2!A2:A,Sheet2!B2:B},2,false),""),iferror(vlookup(A2:A, {Sheet2!A2:A,Sheet2!C2:C},2,false),""),
iferror(vlookup(A2:A, {Sheet2!A2:A,Sheet2!D2:D},2,false),""),iferror(vlookup(A2:A, {Sheet2!A2:A,Sheet2!E2:E},2,false),"")
})
A better alternative suggested by marikamitsos is this:
=ArrayFormula(IFERROR(VLOOKUP(A2:A,Sheet2!A2:E,{2,3,4,5})))
Try below.
=INDEX(Sheet2!B:B,MATCH(A2,Sheet2!A:A,0))
If you want Vlookup() then use-
=VLOOKUP($A2,Sheet2!$A:$E,COLUMN(B$1))

How can I use nested formulas in the ARRAYFORMULA function in Google Sheets?

I need Google Sheets to compute sums for each row using the arrayformula() function.
I know I can manualy enter somthing like;
=ARRAYFORMULA(A:A + B:B + C:C)
but I need the use of the functions to do it.
I've tried many things including;
=ARRAYFORMULA(sum(A:A,C:C))
Here is a sample file that I could use help with.
This formula works in cell G3 of your test sheet:
=ArrayFormula(mmult(ARRAYFORMULA(IF(ISBLANK(A3:C),0,A3:C)),sign(transpose(column(A3:C)))))
I've used a custom format to hide the zero values on the empty rows as well
Formulas
Addition (SUM)
QUERY function
=QUERY(A3:C20,"Select A+B+C Label A+B+C ''")
Concatenation
& operator
=ArrayFormula(J3:J20&K3:K20&L3:L20)
CONCAT function
=ArrayFormula(CONCAT(CONCAT(J3:J20,K3:K20),L3:L20))
Explanation
Besides ARRAYFORMULA, Google Sheets has QUERY, FILTER, ARRAY_CONSTRAIN, among other functions that could help you to handle array operations. Take a look to Function List to have the complete list. Also could be very helpful that you to take a look to Using arrays in Google Sheets.

Average calories of "moderate" food

I keep a spreadsheet with caloric information about food. Each row represents a product labelled as {negative, small, moderate} and the number of calories.
I included a shared copy of the spreadsheet.
Table
Shared table
I would like to calculate the average of the numbers that are in the same row as the keyword 'moderate'. For instance, I would like to obtain something like (890+914+731+1159+789)/5=897. I have tried =AVERAGE(B3,B7:B10) and it works but it needs to be modified when I add another product.
The expected output is in red. I want to obtain such output using formulas.
Thanks in advance
Maybe you can also consider the use of AVERAGEIF() as it seems the function is built for situations like this:
=averageif(A2:A; "moderate"; B2:B)
When you insert new row, formula will be modified automatically. Also, your formula is wrong, missing semicolon:
=AVERAGE(B3; B7:B10)
^
You can Use a IF Statement. Then you automatically do the average of the numbers IF the respective value is moderate. This is better, because it will work, if you have 5 or 5000 Moderates
Just use: =AVERAGE(FILTER(B2:B10;(A2:A10="moderate")))
You could also use SUMIF with COUNTIF, it's a more basic formula, not as powerful as FILTER, but just as funcitonal. Also to use unlimited ROWs, you can remove the number on the second part of the RANGE, this for any formula, in this case your formula would be as such:
=SUMIF(A2:A;"moderate";B2:B)/COUNTIF(A2:A;"moderate")

[google spreadsheets]Joining Multiply Arrays in one formula

I am long looking for solution to a problem that states as this:
I have 3 different ranges in my spreadsheet (lets say they are on different sheets) and I want to join them all on the 4th sheet as one array (like one under another).
And here is my question how can I dot it? I want to then use filter on the given range to make all 3 ranges one sorted range and I want it to enlarge dynamically when I add new rows to one of the source ranges.
I basically tried to use Arrayformulas and query formulas but I didnt found any solution.
Does anybody have any clue or idea how to solve this problem?
Thanks in Advance
volmort
You can use "Embedded Arrays" to achieve this result.
Source Data in:
D6:F9
H6:J9
L6:N9
Formula to aggregate all data ranges:
=FILTER(
{ARRAYFORMULA(D6:F9);ARRAYFORMULA(H6:J9);ARRAYFORMULA(L6:N9)}
, {ARRAYFORMULA(D6:D9);ARRAYFORMULA(H6:H9);ARRAYFORMULA(L6:L9)} <> ""
)
Note: un-populated rows in the source data ranges are "filtered" from the results. An un-populated row is a row with no data in the first column of the range.
If this result is not desired, then a simpler version with ARRAYFORUMULA could be used:
=ARRAYFORMULA(
{ARRAYFORMULA(D6:F9);ARRAYFORMULA(H6:J9);ARRAYFORMULA(L6:N9)}
)
Here is an demonstration of the solution:
https://docs.google.com/spreadsheets/d/1HTyIpaLU0dm89ZY8ka9SI0J2nywnS9QteFY1h9BxdR0/edit?usp=sharing

Resources