cell equal to range

aspiringnerd

New Member
Joined
Apr 22, 2022
Messages
39
Office Version
  1. 365
Platform
  1. Windows
Is it possible to have a cell equal to a range a1-a50 where only 1 cell within that range will have text and the rest are blank? if I formulate cell b1 as =a1:a50 then it also enters b2:b50 with zeroes which I don't want as it affects other data on that row.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
You cannot really set one cell equal to a whole range (it doesn't even really make sense, logically).
However, if you just want to see if the value in a certain cell is found within a range of cells, you can do that easily using the COUNTIF function.
Just count how many times that particular value occurs in that range. If the formula returns a value greater than 0, then that value is found in that cell.
If it returns 1, then it is found exactly once in that range.

See: MS Excel: How to use the COUNTIF Function (WS)
 
Upvote 0
You cannot really set one cell equal to a whole range (it doesn't even really make sense, logically).
However, if you just want to see if the value in a certain cell is found within a range of cells, you can do that easily using the COUNTIF function.
Just count how many times that particular value occurs in that range. If the formula returns a value greater than 0, then that value is found in that cell.
If it returns 1, then it is found exactly once in that range.

See: MS Excel: How to use the COUNTIF Function (WS)
I'm not really counting though, occasionally the results will be numbers but a lot of the time it will just be text. I'm trying to capture a range of data that will mostly be blank except 1 cell. It will always just be 1 cell that isn't blank, but it's random.

I should also add, that there is no predictable pattern to what the text could contain.
 
Upvote 0
So what exactly is it that you are trying to ultimately do here?
Are you trying to identify where the non-empty cell is?
Or are you trying to get the value of this non-empty cell?

Once we have a better idea of what you are ultimately trying to do here, we may be able to come up with something that does what you want.
 
Upvote 0
figured it, but it's long. I used the IFS function
I am willing to bet there is a better option, if you just answer my questions and let me know which version of Excel you are using.
 
Upvote 0
I am willing to bet there is a better option, if you just answer my questions and let me know which version of Excel you are using.

I have a cell and I want it to equal the only non empty cell in a given range. I'm using 365
 
Upvote 0
VBA Code:
=INDEX(Sheet1!M2:CH2,MATCH(FALSE,ISBLANK(Sheets1!M2:CH2),0))
I've tried using this but it only ever returns the first value in the array if true. I tested other cells but returns a 0 in all other positions except position 1
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

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