Search cell range and return value dependant on position of non blank cell

Dermotdjt

New Member
Joined
Apr 19, 2011
Messages
4
Trying to work out how to search a cell range for a non blank cell and dependant on the position of the non blank cell return a set value.

So cell range B3:G3 should only have one non blank cell.
Cell range B10:G10 contian the values 9,19,29,39,49 & 59

if B3 is non blank return value from B10, ie 9
if C3 is non blank return value from c10, ie 19
etc

If this is possible, would it then be possible to return another value (ie ERR) if more than 1 cell in the range is non blank

Many thanks
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Trying to work out how to search a cell range for a non blank cell and dependant on the position of the non blank cell return a set value.

So cell range B3:G3 should only have one non blank cell.
Cell range B10:G10 contian the values 9,19,29,39,49 & 59

if B3 is non blank return value from B10, ie 9
if C3 is non blank return value from c10, ie 19
etc

If this is possible, would it then be possible to return another value (ie ERR) if more than 1 cell in the range is non blank

Many thanks
What type of data is in B3:G3?

Maybe this...

=SUMIF(B3:G3,"<>",B10:G10)
 
Upvote 0
HI Biff

That would seem to work. The data in the range will be non-numeric. It will probably just be an 'X', to show that that cell/column has been selected.

Also using you formula if more than 1 cell in the range is non blank then the return value will not be one of the prescribed values.

Many thanks
 
Upvote 0
HI Biff

That would seem to work. The data in the range will be non-numeric. It will probably just be an 'X', to show that that cell/column has been selected.

Also using you formula if more than 1 cell in the range is non blank then the return value will not be one of the prescribed values.

Many thanks
Ok, you said:

So cell range B3:G3 should only have one non blank cell.
So, if more that one cell has an entry what result do you expect?

Book1
BCDEFG
3XX
4
5
6
7
8
9
1091929394959
Lists
 
Upvote 0
Ideally if more than one cell has an entry then return ERR to show that an ERROR has been been in selecting cells.
 
Upvote 0
Ideally if more than one cell has an entry then return ERR to show that an ERROR has been been in selecting cells.
Ok, that's easy enough to handle...

=IF(COUNTA(B3:G3)>1,"ERROR",SUMIF(B3:G3,"<>",B10:G10))

However, that raises another issue...

What if there is no entry in B3:G3 at all? The formula will return 0.
 
Upvote 0
No, a zero value would be fine and may actually be desirable. I'll have to check that with the user. Many thanks for such a prompt response.
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,240
Members
452,898
Latest member
Capolavoro009

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