IF command Help

bionerd

New Member
Joined
Feb 10, 2016
Messages
4
Hello,

I’m attempting write a funky IF command to construct the matrix below and I’m stuck. This is what I'm trying to achieve. I know it's a combination of IF and perhaps the RIGHT functions, but I can't seem to put it all together correctly...


Species 1
(1)
Species 2
(10)
Species 3
(100)
Species 4
(1000)
Species 5
(10000
101111010
1001001001
1101001011
10110100
10000100
1101001011

<tbody>
</tbody>


Any help is much appreciated. The far left column and top row are what I currently have in my spreadsheet. I'm just trying to figure out what I need to put in the cells to achieve the 1/0 matrix.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Perhaps you could explain how you are populating the table? (It may be obvious, but I cant see it)
 
Upvote 0
Species 1
(1)
Species 2
(10)
Species 3
(100)
Species 4
(1000)
Species 5
(10000
1011
10010
11010
101
100
11010

<tbody>
</tbody>

This is my current working table. I'm trying to fill it with a command that does something like this:

Here would be an example for the formula in cell B2:
=IF(first character from the right is "1", 1, 0)

Then C2 would be...
=IF(second character from the right is "1", 1, 0)D2
=IF(third character from the right is "1", 1, 0)E2
=IF(fourth character from the right is "1", 1, 0)D2
=IF(fifth character from the right is "1", 1, 0)



Then I would drag the formulas down to complete the table.
 
Upvote 0
Species 1
(1)
Species 2
(10)
Species 3
(100)
Species 4
(1000)
Species 5
(10000
1011
10010
11010
101
100
11010

<tbody>
</tbody>

This is my current working table. I'm trying to fill it with a command that does something like this:

Here would be an example for the formula in cell B2:
=IF(first character from the right is "1", 1, 0)

Then C2 would be...
=IF(second character from the right is "1", 1, 0)

D2
=IF(third character from the right is "1", 1, 0)

E2
=IF(fourth character from the right is "1", 1, 0)

D2
=IF(fifth character from the right is "1", 1, 0)



Then I would drag the formulas down to complete the table.
 
Upvote 0
Perhaps this? (It doesn't agree with your sample answer in post 1)...
A​
B​
C​
D​
E​
F​
1​
Species 1Species 2Species 3Species 4Species 5
2​
-1-10-100-1000(10000
3​
10111011
4​
1001010010
5​
1101011010
6​
101101
7​
100100
8​
1101011010
B3=MID($A3,COLUMN(A1),1)
copied down and across
 
Upvote 0
That'll work. Thanks! I'll just switch the species. Instead of Species 1 -> Species 5 across the top row, it'll be 5->1.
 
Upvote 0
Hi,

This should work with your setup:


Excel 2010
ABCDEF
1Species 1Species 2Species 3Species 4Species 5
2(1)(10)(100)(1000)(10000)
3101111010
41001001001
51101001011
610110100
710000100
81101001011
Sheet1
Cell Formulas
RangeFormula
B3=IF(LEN(B$2)-2>LEN($A3),0,LEFT(RIGHT($A3,LEN(B$2)-2),1))


Copy B3 formula down and across.
 
Upvote 0

Forum statistics

Threads
1,215,274
Messages
6,123,998
Members
449,137
Latest member
abdahsankhan

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