Excel formula help

excel_learnerz

New Member
Joined
Dec 12, 2018
Messages
34
in excel is it possible with a formula to compare two columns, just two

column 1 the data in the row looks like (2, 4, 5, 3)

column 2 (0, 1, 0, 1)

so in column 3 it would be (4, 3) as i only want to use the values where column 2 has a 1 value
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
62,444
Office Version
  1. 365
Platform
  1. Windows
What version of Excel are you using?
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also can you post some sample data along with expected results.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 

Radoslaw Poprawski

Active Member
Joined
Jun 19, 2021
Messages
326
Office Version
  1. 365
Platform
  1. Windows
Book5
ABCDEFGHI
1Numbers / databooleanby filter:by power query:by power query:
2000filter by: (enter 0 or 1)
30101
4204
5014
6709Numbers / dataNumbers / data
74100
85000
94144
105044
119199
12
13
Sheet1
Cell Formulas
RangeFormula
D2:D6D2=FILTER($A$2:$A$11,$B$2:$B$11=1)
Dynamic array formulas.


No helper Table for PQ - manual filter change required:
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Filtered Rows" = Table.SelectRows(Source, each ([boolean] = 1)),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"boolean"})
in
    #"Removed Columns"

Helper Table to choose alue from:
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Filtered Rows" = Table.SelectRows(Source, each ([boolean] = #"0or1")),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"boolean"})
in
    #"Removed Columns"

Power Query:
= Excel.CurrentWorkbook(){[Name="Table3"]}[Content]{0}[#"filter by: (enter 0 or 1)"]

 

Forum statistics

Threads
1,141,403
Messages
5,706,257
Members
421,435
Latest member
Yoga15

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
Top