MAP(TRIMRANGE(), LAMBDA into Template sheet

LVExcel

Board Regular
Joined
Nov 23, 2011
Messages
64
Office Version
  1. 365
Platform
  1. Windows
Hi all, this formula was recently presented for a question on BYROW

=MAP(TRIMRANGE(AC8:AC38),LAMBDA(row,IF(row>AY$7,"OVER","UNDER")))

Can it be customized to get data from another sheet?

I have two sheets, sheet-1 is my template used to import data to our billing system, it requires a particular format and column order.
Then I have my calculated detail data in sheet-2 with hundreds of columns and thousands of rows with my formulas within the detail.
I only need about 20 columns from Sheet-2 into my template (Sheet-1) in the correct order, but don't want to always have to copy formulas down, and check that I'm capturing every row in sheet-2, which constantly changes number of rows.

I tried to customize the formula but am not getting the correct results.

Example: Sheet-1 Column A1 will include all the data in Sheet-2 Column G:G; B1 will present all rows in E:E, and so forth.

Thanks in advance for your help.
 
Yes, you can get it to work from another sheet and extend the range, as below:
Excel Formula:
=MAP(TRIMRANGE(Sheet2!AC8:AC10000),LAMBDA(row,IF(row>AY$7,"OVER","UNDER")))

However, with that particular formula, you wouldn't need to use MAP or LAMBDA, see below:
Excel Formula:
=IF(TRIMRANGE(Sheet2!AC8:AC10000)>AY$7,"OVER","UNDER")
 
Upvote 0
You can also use Trim Refs to write the formula a little more succinctly than with the actual TRIMRANGE function. For example, this would do the same job as the last formula in the above post
Excel Formula:
=IF(Sheet2!AC8.:.AC10000>AY$7,"OVER","UNDER")

or if your data is set up so that there is always data starting at AC8 you would only need to trim the range at the bottom
Excel Formula:
=IF(Sheet2!AC8:.AC10000>AY$7,"OVER","UNDER")
 
Upvote 0
Yes, you can get it to work from another sheet and extend the range, as below:
Excel Formula:
=MAP(TRIMRANGE(Sheet2!AC8:AC10000),LAMBDA(row,IF(row>AY$7,"OVER","UNDER")))

However, with that particular formula, you wouldn't need to use MAP or LAMBDA, see below:
Excel Formula:
=IF(TRIMRANGE(Sheet2!AC8:AC10000)>AY$7,"OVER","UNDER")
Thank you very much, that was very helpful.
 
Upvote 0
You can also use Trim Refs to write the formula a little more succinctly than with the actual TRIMRANGE function. For example, this would do the same job as the last formula in the above post
Excel Formula:
=IF(Sheet2!AC8.:.AC10000>AY$7,"OVER","UNDER")

or if your data is set up so that there is always data starting at AC8 you would only need to trim the range at the bottom
Excel Formula:
=IF(Sheet2!AC8:.AC10000>AY$7,"OVER","UNDER")
Thank you very much Peter for all your help, that is simpler.

Follow-up Question for you:
Is there a way to use a combination of these functions in a formula to simply show data from another sheet.
I need to Map data from a couple of columns in Sheet2 to Sheet1, no calculations needed. What I'm looking to do is autofill which ever column from Sheet2 via an autofill formula, and not continue to check back to see if I'm capturing everything from Sheet2.
 
Upvote 0
Thank you very much Peter for all your help, that is simpler.
You're welcome. Glad to contribute. Thanks for the follow-up. :)

Is there a way to use a combination of these functions in a formula to simply show data from another sheet.
I need to Map data from a couple of columns in Sheet2 to Sheet1, no calculations needed. What I'm looking to do is autofill which ever column from Sheet2 via an autofill formula, and not continue to check back to see if I'm capturing everything from Sheet2.
The best way might depend on exactly what you are trying to do and I'm not sure I understand what that is.
Do you mean if Sheet2 is like this ..

LVExcel.xlsm
ABC
1A1B1C1
2A2B2C2
3A3B3C3
4A4B4C4
5A5B5C5
6B6C6
7B7C7
8B8C8
9B9C9
10B10
11B11
12B12
13
Sheet2


.. and you want to capture columns C and A then you might choose one of these methods. In the second method, where I have used row 1000, just choose a number bigger that your data will ever be.

LVExcel.xlsm
ABCDEF
1C1A1C1A1
2C2A2C2A2
3C3A3C3A3
4C4A4C4A4
5C5A5C5A5
6C6C6
7C7C7
8C8C8
9C9C9
10
Sheet1
Cell Formulas
RangeFormula
A1:B9A1=LET(a,TRIMRANGE(CHOOSECOLS(Sheet2!A:Z,3,1)),IF(a="","",a))
E1:E9E1=LET(a,Sheet2!C1:C1000,FILTER(a,a<>""))
F1:F5F1=LET(a,Sheet2!A1:A1000,FILTER(a,a<>""))
Dynamic array formulas.


If this is not what you meant then please give a small dummy sample and the expected results with XL2BB and explain again in relation to that sample data.
(If you have trouble with XL2BB, review the "XL2BB Icons greyed out" link in the 'Known XL2BB issues' section near the top of the XL2BB Instructions page linked above.)
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top