Translate the .Formula1 in Conditional Formats to english fo

Juan Pablo González

MrExcel MVP
Joined
Feb 8, 2002
Messages
11,959
In VBA, one good thing is that you can use the local language formulas or, you can code the english formulas, with the same results.

However, this does not apply to all objects, very unfortunately. Two that come to mind right now are Conditional formatting and Data Validation.

They both return the formula in the local language. This could be "easily" translated using a Sub, assigning the FormulaLocal to this cell, then, using the Formula, getting it in english, right ? well, I need to do this in a UDF... and, since a UDF can't make changes to the cells, I'm stuck.

I have a big table, downloaded from http://www.bmsltd.co.uk that has the "formula translations", that is good, I can do a massive substitute, but I feel I'm complicating things.

Any ideas on how to do this ?
 
On 2002-09-11 18:14, Aladin Akyurek wrote:
=COUNTIF(A1:A10,">=3.6")

should be translated as

=AANTAL.ALS(A1:A10,">=3,6")

The issue is that the decimal separator of a number in double quotes are not translated by Excel from dot to comma. (.ARG was my mistake /board/images/smiles/icon_biggrin.gif. It's .ALS).

Hey, don't confuse me more ! I forgot about that, decimal separator as well... I'm now curious about something, can you try this please ? in the VB Editor, press Control G (Make sure you have an (empty) worksheet selected), and put this in there and press Enter:

ActiveCell.Formula = "=COUNTIF(A1:A10,"">=3.6"")"

Does the formula appear correctly in Excel ? I mean, does it work ? I would think that it should ! or MS is really missing the point here !
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
On 2002-09-11 18:19, Juan Pablo G. wrote:
On 2002-09-11 18:14, Aladin Akyurek wrote:
=COUNTIF(A1:A10,">=3.6")

should be translated as

=AANTAL.ALS(A1:A10,">=3,6")

The issue is that the decimal separator of a number in double quotes are not translated by Excel from dot to comma. (.ARG was my mistake :biggrin:. It's .ALS).

Hey, don't confuse me more ! I forgot about that, decimal separator as well... I'm now curious about something, can you try this please ? in the VB Editor, press Control G (Make sure you have an (empty) worksheet selected), and put this in there and press Enter:

ActiveCell.Formula = "=COUNTIF(A1:A10,"">=3.6"")"

Does the formula appear correctly in Excel ? I mean, does it work ? I would think that it should ! or MS is really missing the point here !

Juan,

I don't have a Dutch version at home. Believe me Excel's parser does not look at what is between double quotes...presumably because such things are simply text. Programmers have apparently forgatten all about the use of double quotes as arg specifiers in COUNTIF and SUMIF.

Aladin
 
Upvote 0
Yes, just tried that on my English version of Excel. Changed my regional settings to work with , as decimal separator, and the COUNTIF took it as a string... man, I think I'm going to give up on this...

This is for the GETCOLOR() formula, have you had the chance to look at it ? I wanted to include the current conditional formatting color in there, not just the cell's color, but the cell that the user sees. Everything works fine except for this little detail... I think this should work ok in an english version tough.
 
Upvote 0
On 2002-09-11 18:46, Juan Pablo G. wrote:
Yes, just tried that on my English version of Excel. Changed my regional settings to work with , as decimal separator, and the COUNTIF took it as a string... man, I think I'm going to give up on this...

You might need to write a preprocessor that uses a large lookup table of function names and does some syntactic parsing...

This is for the GETCOLOR() formula, have you had the chance to look at it ? I wanted to include the current conditional formatting color in there, not just the cell's color, but the cell that the user sees. Everything works fine except for this little detail... I think this should work ok in an english version tough.

You mean the GETCOLOR function of your add-in?

OK. A1 has Yellow as Fill Color. What formulas with GETCOLOR are possible regarding A1?
This message was edited by Aladin Akyurek on 2002-09-11 19:11
 
Upvote 0
On 2002-09-11 19:10, Aladin Akyurek wrote:
You mean the GETCOLOR function of your add-in?
OK. A1 has Yellow as Fill Color. What formulas with GETCOLOR are possible regarding A1?
Ok, in its simplest form
=GETCOLOR(A1)
would return 6, wich is the ColorIndex of yellow. Well, I think it's easier to show with some examples:
Book4
ABCDE
1BackgroundColorIndexBackgroundRGBColorFontColorIndexFontRGBColor
2ThistextisinAutomatic665535-41050
3ThistextisinBlack381340876710
4ThistextisinRed37167640573255
Sheet1


and working with more cells...
Book4
ABCDE
6ArrayofAllColorsArrayofUniqueColorsCountofAllColorsCountofUniqueColors
76685
8-4142-4142
9383885
10637
113736
1238
1336
1438
Sheet1


you can combine this, with SUMPRODUCT for example to get a COLORCOUNTIF or COLORSUMIF (Altough I have both in the new version, much faster than using SUMPRODUCT), or enable you to sort by color, etc.
 
Upvote 0
Remember I have still that problem that the functions are "unregistered". That is, the evaluator of the calculation engine doesn't execute them.
 
Upvote 0

Forum statistics

Threads
1,216,090
Messages
6,128,765
Members
449,467
Latest member
sdafasfasdf

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