Find the text from a range of cells on the same row.

andymalan

Board Regular
Joined
Feb 22, 2017
Messages
128
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Greetings esteemed and learned people of Excel. Please help me with a problem that I thought I could easily handle, by using the max formula.
I need to find the Height, Width and Depth of a series of cabinets.
Each row caters for one cabinet, resulting in only one of the cells to have a value, hence:
=MAX(DV2,EB2,EH2,EN2,ET2,EZ2,FF2,FL2,FR2,FX2,GD2,GJ2,GP2,GV2,HB2,HH2,HN2,HT2,HZ2,IF2)

The above formula to check for the height, the width and depth also have a max formula.

The trouble is, some of the formulas culminate with a text value, and others with a number value, causing the MAX formula to return a 0.

Much appreciation, and many thanks in advance.
Andy
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Could you expand on this a little.
he trouble is, some of the formulas culminate with a text value, and others with a number value

Does that mean that the cells all contain formulas? If so it would be best to 'correct' those formulas so that they return valid numbers.

By text value, do you mean that some contain just a number, while others might contain a measurement, i.e. 600mm instead of 600?
 
Upvote 0
Dear Jason, thanks for your quick response.
here is a small sample of data for row 2.
FQ FR FS FT FU FW FX FY FZ GA
[TABLE="width: 682"]
<tbody>[TR]
[TD="class: xl71, width: 62"]Broom[/TD]
[TD="class: xl67, width: 62"]Height[/TD]
[TD="class: xl67, width: 62"]Width[/TD]
[TD="class: xl70, width: 62"]Depth[/TD]
[TD="class: xl68, width: 62"]Width[/TD]
[TD="class: xl69, width: 62"]0[/TD]
[TD="class: xl71, width: 62"]Grocery[/TD]
[TD="class: xl67, width: 62"]Height[/TD]
[TD="class: xl67, width: 62"]Width[/TD]
[TD="class: xl70, width: 62"]Depth[/TD]
[TD="class: xl68, width: 62"]Width[/TD]
[/TR]
</tbody>[/TABLE]

{FQ2}=IF(ISNUMBER(SEARCH($FQ$1,$B2)), "Broom","") 'compares cell B2 with FQ2 and returns "Broom" if it is a match, else Nothing.

{FR2}=IF(ISNUMBER(SEARCH($FQ$1,$B2)), 2300,"") 'compares cell B2 with FQ2 and returns "2300" if it is a match, else Nothing.

{FS2}=SUBSTITUTE(FU2,"mm"," ") 'Trims "mm" from the number returned

{FT2}=IF(ISNUMBER(SEARCH($FQ$1,$B2)), 560,"")'compares cell B2 with FQ2 and returns "560" if it is a match, else Nothing.

{FU2}=IF(ISNUMBER(SEARCH($FQ$1,$B2)), RIGHT($B2, 6),"") ' extracts part of the text from a cell.


The formulas above are repeated for every Cabinet on rows 2 to 1000

I then run a macro to copy everything on the sheet EXCEPTING the MAX formulas and paste as text.
Next, another macro runs to convert text that look like numbers to numbers
Finally Max should give me the results. Simple. I thought.
 
Upvote 0
Looking at your formulas, it should be returning something, so best guess would be that the macros are not working as they should.

You say that you're pasting as text, I would suggest PasteSpecial - Values if that is not what you are currently using.

If you post your existing code we can help you to amend it as needed.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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