EXCEL VLOOKUP - Extracting multiple columns from one formula - arrays

I'm trying to use a VLOOKUP array formula to extract and display multiple columns using one formula.
Excel Formula:
=VLOOKUP(A15,A1:G9,{3,4,5},FALSE)
1 2 3 4 5 6
Transaction ID Payment Date Product Quantity Cost Sales
MVLN195 1/3/2014 Trash Can 1 $14.00 $14.00
XFYR246 1/4/2014 Lawnmower 1 $599.00 $599.00
DWDF167 1/4/2014 Diapers 1 $29.00 $29.00
YNBM339 1/5/2014 Sweater 3 $59.00 $177.00
WTKQ758 1/7/2014 Bike 1 $599.00 $599.00
SFKS527 1/7/2014 Radio 1 $25.00 $25.00
OGWT288 1/8/2014 Bike 1 $599.00 $599.00
TCQN516 1/9/2014 Calender 5 $3.00 $15.00
1 2 3 4
ID Product Quantity Cost
OGWT288 Bike #N/A #N/A
I've tried using the array vlookup formula, but only column 3 comes up. I've tried to press ctrl shift enter as well but still only data from column is pulled not for the other two.
If anyone could be of any assistance would be very helpful.
Thank You

First of all your formula is correct.
Put it in the first column, in your scenario it's A16.
And then select that cell and drag it upto the next 3 cells.
Move your mouse cursor to the top formula bar and click over, and press ctrl+shift+enter
It should work.
Thanks

Put this in the first cell and drag over:
=VLOOKUP($A$15,$A$1:$G$9,COLUMN(C:C),FALSE)
If you really want to array enter then you can use your formula:
Select B15:D15 with B15 active.
Enter the formula in the formula bar.
Hit Ctrl-Shift-Enter to array enter the formula into all three cells at same time.

Related

Change formula array for every X number of rows in Excel

I have large number of rows of data in Excel where I need to change the row array of the formula for every 3 rows but I can't figure out how to adjust the formula without an error.
How do I add a formula like this to the formula below?
=INT(((ROW(a1)-1)/11))*1+1
This is the formula I have been using, but I need to change it for every 3 rows.
=IF(COUNTIF($N$4:$N$6, ""), "",MAX($N$4:$N$6))
=IF(COUNTIF($N$7:$N$9, ""), "",MAX($N$7:$N$9))
And so on
Example
I have 3 approvers, if "product" is approved, the date is for the approval date of last said approval, if no approval has been made then the cell is blank. Outcome is what I want to collect from column 3 when product was approved from all 3 approvers which is the newest date of the 3 rows, if one approver has not approved, then I'd like column 4 to be blank.
Product
Approvers
Dates
Outcome
A
1
04.01.2016
04.01.2016
A
2
17.12.2015
04.01.2016
A
3
21.12.2015
04.01.2016
B
1
11.04.2017
11.04.2017
B
2
30.01.2017
11.04.2017
B
3
04.04.2017
11.04.2017
C
1
C
2
13.10.2016
C
3
14.02.2017
D
1
01.03.2022
01.03.2022
D
2
02.12.2019
01.03.2022
D
3
30.01.2020
01.03.2022
Picture of data
Two options:
To answer the original question, to make your formula change every n rows, use =-MOD(ROW()+c, n) to adjust this (where 'c' is a constant just to get them in line, if your data starts on row 2 then c would be 1).
Your formula for row 2 would be:
=IF(COUNTIF(OFFSET($N2,-MOD(ROW($N2)+1,3),0,3),""),"",MAX(OFFSET($N2,-MOD(ROW($N2)+1,3),0,3)))
Another option, not as direct an answer to the question but potentially useful if the number of products changed in future from 3 to something else, would be:
=IF(COUNTIFS(L:L, L2, N:N, ""), "", MAX(IF(L:L=L2, L:L)))
and click Ctrl+Shift+Enter after typing that in (because it's an Array formula, see here, here and here).
The advantage of this approach is that it looks at all rows where the product column is the same (I'm assuming unique products), so no need to limit it to 3 rows per product or have those 3 rows next to each other.

GDS doesn't show all rows / sum all values when I have 2 same rows of blending data

GDS doesn't show all rows / sum all values when I have 2 same rows of blending data.
I am doing a report that shows data filtered by email.
It took me 2 days but hopeless to find the root cause
Please see the screenshot for what I mean
https://i.stack.imgur.com/KJJAn.png
Here's the GDS file.
https://datastudio.google.com/s/kPkRpwDTqbc
The values which should be summed up, need to be in the metrics. Then following result is archived:
Again your raw data:
Date Sales
Rep Bill ID
Qty
Price
Total
Amount
04/08/2021
Dove
12345
1
1
1
04/08/2021
Jone
12346
1
2
2
04/08/2021
Jone
12346
1
2
2
and
Staff
Email
Dove
dove#gmail.com
Jone
dotuanviet1981#gmail.com
For joing, these values have to be in metrics, marked yellow. You put them in dimension - marked red - and therefore these counted once vor duplicated data.

Nested 'for' loops in native Google Sheets (no scripts)

I'm aware that it's possible to emulate a for loop in Google Sheets via the following:
=ARRAYFORMULA(IF(LEN({range_0 to iterate over}),{function_0 for each element in range_0}))
I've not been able to expand on the above approach to achieve the effect of a multi nested for loop. Is this possible? Ideally this would look something like:
=ARRAYFORMULA(IF(LEN({range_0 to iterate over}),IF(LEN({range_0.1 to iterate over for each parent element in range_0}),{function_0.1 for each element in range_0.1},{OPTIONAL: function_0 for each element in range_0})))
Example application:
Iterating over each cell in a row for each row in a column (see below; I'm sure there are ways to achieve this effect via other methods, but I have use for the requested and specified method for cases where a single dynamic formula is necessary to keep up with an unknown and changing number of rows, columns, and functions involved):
Raw data:
Thing
Type
Feature
Cost
Apple
Fruit
Seeds
$1
Car
Automobile
Wheels
$6,000
Laptop
Computer
Keyboard
$500
Grape
Fruit
Tastiness
$0.50
Theoretical formula:
=ARRAYFORMULA(IF(LEN(`Thing`),IF(LEN(COLUMNS({current row of `Thing`})),{current cell in current row of `Thing`} & " of column " & COLUMN({*current cell*}) & " and row " & ROW(`Thing`),""),""))
Output of above theoretical formula:
Thing
Type
Feature
Cost
Apple of column 1 and row 3
Fruit of column 2 and row 3
Seeds of column 3 and row 3
$1 of column 4 and row 3
Car of column 1 and row 4
Automobile of column 2 and row 4
Wheels of column 3 and row 4
$6,000 of column 4 and row 4
Laptop of column 1 and row 5
Computer of column 2 and row 5
Keyboard of column 3 and row 5
$500 of column 4 and row 5
Grape of column 1 and row 6
Fruit of column 2 and row 6
Tastiness of column 3 and row 6
$0.50 of column 4 and row 6
Thank you for your help!
try:
=ARRAYFORMULA(IF(LEN(A3:E7), A3:E7&" of column "&COLUMN(A3:E7)&" and row "&ROW(A3:E7), ))

Higlight the dominating number in excel, most repeated for each keyword

Is this possible using excel formulas? To find keyword and number then match and color the highest number for that specific keyword, e.g. below:
this is the list Cell A keyword and B numbers
shoes 9
shoes 5
shoes 3
furniture 2
furniture 4
furniture 5
beauty 6
beauty 8
health 35
health 4
health 2
grocery 3
grocery 2
computers 9
computers 7
laptop 2
laptop 11
laptop 2
laptop 6
pets 9
pets 3
books 5
books 5
shoes 9 Highlight this number
shoes 5
shoes 3
furniture 2
furniture 4
furniture 5 Highlight this number
beauty 6
beauty 8 Highlight this number
health 35 Highlight this number
health 4
health 2
grocery 3 Highlight this number
grocery 2
computers 9 Highlight this number
computers 7
laptop 2
laptop 11 Highlight this number
laptop 2
laptop 6
pets 9 Highlight this number
pets 3
books 5 ignore if its equal
books 5
You can use conditional formatting, choosing "Use a formula..." and use a formula such as =b1=maxifs($B$1:$B$100,$A$1:$A$100,a1). Be mindful of absolute vs. relative reference to ensure that you're tracking the right ranges.
In particular when tagged vba you should be showing what you have tried. macros Usage guide specifically states "DO NOT USE for VBA / MS-Office languages" and excel wiki states "Questions tagged with excel should be version-agnostic.". However, with a formula is possible in versions earlier than those with MAXIFS (ie not: Excel for Office 365 Excel for Office 365 for Mac Excel 2016 Excel 2016 for Mac Excel Online Excel for iPad Excel for iPhone Excel for Android tablets Excel for Android phones Excel Mobile), if in a more long-winded way:
Assuming you have 11 in B18. Add a column (say I) and populate I1 with 0 and enough of it from I2 downwards with:
=IF(A1<>A2,I1+1,I1)
copied down to sort your data on ColumnI Smallest to Largest then by ColumnB Largest to Smallest (to preserve the order of the values in ColumnA).
Then select B2 down to as far as required, clear any existing CF rules from it and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=AND(A1<>A2,B2<>B3)
Format..., select choice of formatting, OK.
The above should not, as specified, highlight the values for books though if working I suspect #nutsch's current answer might.
Sorry, I forgot to adjust my guess for what was where, once I realised a header row would make things easier.
This does though stil have a problem, in that text that changes from one row to the next but shares the same quantity, one row to the next, will not trigger highlighting - a more complex formula may be required.
based on #pnuts idea, found a simpler way to do it.
Sort Z to A of B row, then sort column A, A to Z, with expand the selection for both
next write a formula to highlight duplicates excluding the first one from column A and drag down the formula, it higlights all the correct ones.
thank you

Reference a specific field in the details section to make field on the report footer - Crystal reports

My data/table that appears in the details section is pulled from SQL.
It essentially is a basic table with Row Names in column 1 and dates going across row 1 with the final column being a summation of the data.
The data is 4 rows long and what I am looking to do is create a field that I can put in the report footer that will display the same information as any one of the individual fields that is displayed in the totaled column (last column) of the table / details section.
For example if the 3rd row totaled 12 (in the details section of the report), I would like to create a standalone field that will display the 12 in the report footer.
The details section looks like a table: the report footer breaks out certain things from the details section. I need something that will allow me to reference the individual numbers in the details for example: only pull in the 18 or only pull in the 11 into its own little field on the report footer. Thanks.
Months 1 2 3 4 total
Jack 3 3 4 5 15
Will 4 7 5 2 18
Mike 1 3 3 5 12
Don 3 5 2 1 11
You need to manipulate by storing in the array and retriving one by one.
To store in array:
Create a formula #Total
Shared Numbervar array x;
x:=x+(total);
total
In report footer write one more formula #display
Shared Numbervar array x;
x[1] // first element in the same way 2,3,4 will give you all elements
Let me know in case any issue.

Resources