If Row Contains Value in Cell, Return Column Number

samcritchlow

New Member
Joined
Nov 23, 2020
Messages
5
Office Version
  1. 2016
Platform
  1. Windows
Hi, very first post here, hoping someone can help.

I'm trying to devise a formula for a number of cells in column C that returns TRUE IF the column matching the current week number (stored in B2) on the same row as the formula is not blank.

Hopefully the image below helps with the description above

Many Thanks!
Sam

Screenshot 2020-11-23 105717.jpg
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hey, could you try in C6 (then drag formula down):

IF(INDEX($E$3:$I$9,ROWS($C$3:$C6),MATCH($B$2,$E$3:$I$3,0))=0,FALSE(),TRUE())
 
Upvote 0
Solution
You're welcome, though it might not behave how you'd like if you input 0 into the cell (e.g. put 0 in cell G6), if this is the case you can try this other formula in C6:

IF(SUMPRODUCT(($B$2=$E$3:$I$3)*(NOT(ISBLANK($E6:$I6))))=1,TRUE(),FALSE())
 
Upvote 0
You're welcome, though it might not behave how you'd like if you input 0 into the cell (e.g. put 0 in cell G6), if this is the case you can try this other formula in C6:

IF(SUMPRODUCT(($B$2=$E$3:$I$3)*(NOT(ISBLANK($E6:$I6))))=1,TRUE(),FALSE())
Thanks for this follow-up. When working it into my actual sheet I did modify to use ISBLANK and it worked a treat! (y)
 
Upvote 0
One additional question (out of curiosity more than anything):

Is there a way to make the lookup array span across an infinite amount of columns from the start point?
 
Upvote 0
Sure, in the SUMPRODUCT formula just change the upper bound column in parallel with changing the ISBLANK upper bound column, the one provided gives upper bounds of column I.

If you are to change one you must also change the other to span an equal amount of columns otherwise you will return #N/A error.

So for example;

IF(SUMPRODUCT(($B$2=$E$3:$I$3)*(NOT(ISBLANK($E6:$I6))))=1,TRUE(),FALSE())

Becomes:

IF(SUMPRODUCT(($B$2=$E$3:$XFD$3)*(NOT(ISBLANK($E6:$XFD6))))=1,TRUE(),FALSE())

Where XFD is the final column you can have on a spreadsheet. (Excel spreadsheets contains 2^14 columns = 16384 currently & (2^20 rows (1048576) if curious about rows)
 
Upvote 0
Sure, in the SUMPRODUCT formula just change the upper bound column in parallel with changing the ISBLANK upper bound column, the one provided gives upper bounds of column I.

If you are to change one you must also change the other to span an equal amount of columns otherwise you will return #N/A error.

So for example;

IF(SUMPRODUCT(($B$2=$E$3:$I$3)*(NOT(ISBLANK($E6:$I6))))=1,TRUE(),FALSE())

Becomes:

IF(SUMPRODUCT(($B$2=$E$3:$XFD$3)*(NOT(ISBLANK($E6:$XFD6))))=1,TRUE(),FALSE())

Where XFD is the final column you can have on a spreadsheet. (Excel spreadsheets contains 2^14 columns = 16384 currently & (2^20 rows (1048576) if curious about rows)
Great, thanks again
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,734
Members
448,987
Latest member
marion_davis

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