views:

131

answers:

1

I am using C++ and I am generating a csv file to report some of my testing output. There are some 1000 odd test iterations and each iteration output consumes a row in excel. The reason I use CSV file is so that I can use excel sheet to open it and view the outputs.

Now, I would like to use the formula capability of excel sheet thru CSV. Hence, I generate a string like "=A1+A2" for a particular cell and it works.

Now, I would like to have a formula like this and further, based on that formula output, I would like to change the format of the cell, or to print the output of that formula as a STRING like PASS/FAIL etc.

How can i write such a formula in excel. Firstly is that possible. If yes, how and Is it possible to achieve the same thru csv file.

And, if NO, then is there any other alternative way of achieving the same without CSV.

Regards, Arjun

+1  A: 

You need conditional formatting. This allows formatting (including text colour, font, background colour, and in 2007 in cell graphs) to be set by the content of the cell (or another cell).

(I don't think this will be possible through CSV as it is formatting, but the formula driving the formatting could be.)

Richard