Return any value greater than 0 from a range, using excel formula or vba.

andymalan

Board Regular
Joined
Feb 22, 2017
Messages
128
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Greetings, esteemed volunteers.
In cell Y2, I am trying to get any number from the range AC2, AE2, AG2, AI2.
Y2 has the formula: =MAX(AC2,AE2,AG2,AI2), but even though the cell AC2 displays a value, Y2 returns a 0.

1578053246017.png

Each of the cells (AC2,AE2,AG2,AI2) has a formula to determine what value is displayed, as can be seen in AC2 which returns a value of 1.
If the formula in AC2 is deleted and a "1" is typed into the cell, then Y2 does indeed return the value of 1.

1578055280980.png

your help is always appreciated.
kind regards
Andy
 

Attachments

  • 1578055137849.png
    1578055137849.png
    32.8 KB · Views: 12

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Andy, is the result of your formula number in form of text?
 
Upvote 0
If your formula is = xyz maybe test..... = 1*(xyz)
 
Upvote 0
If your formula is = xyz maybe test..... = 1*(xyz)
Hi Snakehips, thank you for picking my question up.
Just for my own peace-of-mind...........did you see the screen shots I sent with my question?
 
Upvote 0
Snakeshiips is asking if the formula in AC2 result is text, if it is, then multilpy the formula by 1 to turn it into a number
 
Upvote 0
Yes, a bit blurry but saw screenshots.
If you post regularly then it's definitely worth downloading and using XL2BB, in order to post a meaningful snippet of your spreadsheet.

As @davesexcel says, I'm asking if the result of your formula eg '1' is text? If it is then it will be ignored by your MAX formula and explain the 0 result.
Prove it ,or not, by editing the formula as suggested.
 
Upvote 0
the result of the formula in AC2 is NOT in text form and that is why the formula in Y2 result is 0.
Formulas
AC2 =IF($U2=$AC$1,$T2,""). the data in cells U2 and AC1 match, therefore the content of T2 is returned, "1"
Y2 =MAX(AC2,AE2,AG2,AI2,AK2,AM2,AO2,AQ2). the formula in Y2 should result in a "1", as AC2 is part of the range that "max" is processing, but it remains "0".

if I type a "1" into AC2, Y2 results in "1".

What can I do to have Y2 return a "1", without losing the formula in AC2?

thanking you in anticipation,
Andy
 
Upvote 0
Is T2 a formula or hard value?
If it's a formula what is it?
 
Upvote 0
Book1
TUVWXYZAAABACADAEAFAGAH
1EdgeThicknessedging_descriptionActual HeightActual WidthmaxmaxNo EdgingNo EdgingE 1 LE 1 LE 1 L 1 SE 1 L 1 SE 1 L 2 SE 1 L 2 SE 1 S
21E 1 L7205590001     
3
Sheet3
 
Upvote 0
Andy, Your formula in T is returning TEXT ... "1"
Try as I said and mod one or other formula to convert to NUMBER
 
Upvote 0

Forum statistics

Threads
1,215,432
Messages
6,124,858
Members
449,194
Latest member
HellScout

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