Combine contents of several cells into one

Bedford

Active Member
Joined
Feb 3, 2015
Messages
316
Office Version
  1. 365
Platform
  1. MacOS
Trying to combine the contents of several cells in sheet 1 for example, which each have simple formulas, example; =IF(C46="","",C46-28), and have the results of these cells in sheet 1 appear in a single cell in sheet 2. The cells in sheet 1 that I wish to combine in sheet 2, will only see one of these several cells having a result based on input from, example; cell C46 in the formula, the other cells with formulas will not be calculating a result as the preceding cell will be empty.
I'm not sure I'm making sense of this?
Thanks.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Not sure I got your question...
If you wish to get the first non-empty cell, then the simplest concept is this:
VBA Code:
=If(Sheet1!A2<>"",Sheet1!A2,IF(Sheet1!B2<>"",Sheet1!B2,IF(Sheet1!C2<>"",Sheet1!C2,"No value")))

Of corse if you have to choose in many many cells, other approach could be simpler than the nested-if approach (the formula that I suggested), but this depends also on how the cells are arraged (contiguous /random) and the Excel Version you use.

Bye
 
Upvote 0
Hi Anthony, that formula worked quite well thank you. Much appreciated!
 
Upvote 0
I may have spoke too soon. The formula works well for return of the values from sheet 1, however in sheet 2 in a dependent cell which has the formula; =IF(B7="","",B7-24), it returns a #VALUE! error, likely because of the "No Value" in the formula. Is there a work around for that?
Thank you.
 
Upvote 0
My formula returns "No value" when you it do not pick any of the cells; it was intended to clearly show that situation, but it is up to you to decide what to do when none of the entries are available... Is that an error situation? Leave the formula as suggested or (better) replace "No value" with NA() . Is than normal? Maybe returning 0 instead of "No value" would be better...

Bye
 
Upvote 0
Indeed the replacing of "No value" with something else returns that other value of something else. The error; #VALUE! is a result of a dependent cell, B13, which contains the formula; =IF(B7="","",B7-24), the formula you provided is in cell B7. Any thoughts on how to have cell B13 show "No value" instead of the error?
 
Upvote 0
The logical way, in B13:
Code:
=IFERROR(IF(B7="","",B7-24),"No Value")
In other words:
Code:
=IFERROR(YourOriginalFormula,"No value")

But with this specific formula, you could use
Code:
=IF(B7="No value","No Value",B7-24)

Bye
 
Upvote 0
Solution

Forum statistics

Threads
1,215,026
Messages
6,122,743
Members
449,094
Latest member
dsharae57

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