diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index b125c5a..27fc8a4 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -5140,11 +5140,13 @@ excel_read_CF_border (GnmStyle *style, ExcelReadSheet *esheet,
 }
 
 static void
-excel_read_CF (BiffQuery *q, ExcelReadSheet *esheet, GnmStyleConditions *sc)
+excel_read_CF (BiffQuery *q, ExcelReadSheet *esheet, GnmStyleConditions *sc,
+	       GnmXLImporter *importer)
 {
 	guint8 type, op;
 	guint16 expr0_len,expr1_len;
 	guint32 flags;
+	guint16 flags2;
 	unsigned offset;
 	GnmStyleCond *cond;
 	GnmStyleCondOp cop;
@@ -5157,6 +5159,7 @@ excel_read_CF (BiffQuery *q, ExcelReadSheet *esheet, GnmStyleConditions *sc)
 	expr0_len = GSF_LE_GET_GUINT16 (q->data + 2);
 	expr1_len = GSF_LE_GET_GUINT16 (q->data + 4);
 	flags = GSF_LE_GET_GUINT32 (q->data + 6);
+	flags2 = GSF_LE_GET_GUINT16 (q->data + 10);
 
 	XL_CHECK_CONDITION (q->length >= 10u + expr0_len + expr1_len);
 
@@ -5243,13 +5246,40 @@ excel_read_CF (BiffQuery *q, ExcelReadSheet *esheet, GnmStyleConditions *sc)
 	overlay = gnm_style_new ();
 
 	offset =  6  /* CF record header */ + 6; /* format header */
+
+	if (flags & 0x02000000) { /* number format */
+		XL_CHECK_CONDITION (q->length >= offset + 2);
+		if (flags2 & 1) {
+			/* Format as string */
+			guint bytes = GSF_LE_GET_GUINT16 (q->data + offset);
+			char *xlfmt = excel_biff_text_2 (importer, q, offset + 2);
+			GOFormat *fmt =	go_format_new_from_XL (xlfmt);
+			gnm_style_set_format (overlay, fmt);
+			go_format_unref (fmt);
+			g_free (xlfmt);
+			offset += bytes;
+		} else {
+			/* Format as index */
+			offset += 2;
+		}
+	}
+
 	if (flags & 0x04000000) { /* font */
 		guint32 size, colour;
 		guint8  tmp8, font_flags;
-		guint8 const *data = q->data + offset + 64;
+		guint8 const *data = q->data + offset;
 
-		XL_CHECK_CONDITION (q->length >= 64 + 54);
+		XL_CHECK_CONDITION (q->length >= offset + 64 + 54);
 
+		if (data[0]) {
+			char *font = excel_biff_text_1
+				(importer, q, offset);
+			gnm_style_set_font_name (overlay, font);
+			g_free (font);
+		}
+
+		data += 64;
+		
 		if (0xFFFFFFFF != (size = GSF_LE_GET_GUINT32 (data)))
 			gnm_style_set_font_size	(overlay, size / 20.);
 		if (0xFFFFFFFF != (colour = GSF_LE_GET_GUINT32 (data + 16)))
@@ -5310,8 +5340,11 @@ excel_read_CF (BiffQuery *q, ExcelReadSheet *esheet, GnmStyleConditions *sc)
 	}
 
 	if (flags & 0x08000000) { /* alignment block */
-		guint16 d1 = GSF_LE_GET_GUINT16 (q->data + offset);
-		guint16 d2 = GSF_LE_GET_GUINT16 (q->data + offset + 2);
+		guint16 d1, d2;
+
+		XL_CHECK_CONDITION (q->length >= offset + 8);
+		d1 = GSF_LE_GET_GUINT16 (q->data + offset);
+		d2 = GSF_LE_GET_GUINT16 (q->data + offset + 2);
 
 		if (0 == (flags & 0x1))
 			gnm_style_set_align_h (overlay,
@@ -5341,8 +5374,13 @@ excel_read_CF (BiffQuery *q, ExcelReadSheet *esheet, GnmStyleConditions *sc)
 	}
 
 	if (flags & 0x10000000) { /* borders */
-		guint16 patterns = GSF_LE_GET_GUINT16 (q->data + offset);
-		guint32 colours  = GSF_LE_GET_GUINT32 (q->data + offset + 2);
+		guint16 patterns;
+		guint32 colours;
+
+		XL_CHECK_CONDITION (q->length >= offset + 8);
+		patterns = GSF_LE_GET_GUINT16 (q->data + offset);
+		colours  = GSF_LE_GET_GUINT32 (q->data + offset + 2);
+
 		if (0 == (flags & 0x0400))
 			excel_read_CF_border (overlay, esheet, GNM_STYLE_BORDER_LEFT,
 					      (patterns >>  0) & 0xf,
@@ -5365,9 +5403,12 @@ excel_read_CF (BiffQuery *q, ExcelReadSheet *esheet, GnmStyleConditions *sc)
 	}
 
 	if (flags & 0x20000000) { /* pattern */
-		guint32 background_flags = GSF_LE_GET_GUINT32 (q->data + offset);
+		guint32 background_flags;
 		int pattern = 0;
 
+		XL_CHECK_CONDITION (q->length >= offset + 4);
+		background_flags = GSF_LE_GET_GUINT32 (q->data + offset);
+
 		if (0 == (flags & 0x10000))
 			gnm_style_set_pattern (overlay,
 					       pattern = excel_map_pattern_index_from_excel (
@@ -5399,7 +5440,8 @@ excel_read_CF (BiffQuery *q, ExcelReadSheet *esheet, GnmStyleConditions *sc)
 }
 
 static void
-excel_read_CONDFMT (BiffQuery *q, ExcelReadSheet *esheet)
+excel_read_CONDFMT (BiffQuery *q, ExcelReadSheet *esheet,
+		    GnmXLImporter *importer)
 {
 	guint16 num_fmts, num_areas;
 	unsigned i;
@@ -5440,7 +5482,7 @@ excel_read_CONDFMT (BiffQuery *q, ExcelReadSheet *esheet)
 			return;
 		}
 		ms_biff_query_next (q);
-		excel_read_CF (q, esheet, sc);
+		excel_read_CF (q, esheet, sc, importer);
 	}
 
 	style = gnm_style_new ();
@@ -6736,7 +6778,9 @@ excel_read_sheet (BiffQuery *q, GnmXLImporter *importer,
 			break;
 		}
 
-		case BIFF_CONDFMT: excel_read_CONDFMT (q, esheet); break;
+		case BIFF_CONDFMT:
+			excel_read_CONDFMT (q, esheet, importer);
+			break;
 		case BIFF_CF:
 			g_warning ("Found a CF record without a CONDFMT ??");
 			break;
diff --git a/plugins/excel/ms-excel-write.c b/plugins/excel/ms-excel-write.c
index f81ae1d..e3ed829 100644
--- a/plugins/excel/ms-excel-write.c
+++ b/plugins/excel/ms-excel-write.c
@@ -1083,7 +1083,6 @@ cb_write_condition (GnmStyleConditions const *sc, CondDetails *cd,
 	BiffPut *bp = esheet->ewb->bp;
 	guint16 range_count;
 	guint8 buf[14], type, op;
-	guint32 flags = 0x0038C380;	/* these are always true */
 	unsigned i, expr0_len, expr1_len, header_pos;
 	GPtrArray const *details = gnm_style_conditions_details (sc);
 	unsigned det_len = details ? details->len : 0;
@@ -1108,13 +1107,36 @@ cb_write_condition (GnmStyleConditions const *sc, CondDetails *cd,
 		GnmStyleCond const *cond = g_ptr_array_index (details, i);
 		GnmStyle const *s = cond->overlay;
 		GnmExprTop const *alt_texpr;
+		guint32 flags = 0x0038C380; /* these are always true */
+		guint16 flags2 = 0x02; /* these are always true */
 
 		ms_biff_put_var_next (bp, BIFF_CF);
 		header_pos = bp->curpos;
 		ms_biff_put_var_seekto (bp, header_pos+12);
 
-		if (gnm_style_is_element_set (s, MSTYLE_FONT_COLOR ) ||
-		    gnm_style_is_element_set (s, MSTYLE_FONT_NAME ) ||
+		if (gnm_style_is_element_set (s, MSTYLE_FORMAT)) {
+			GOFormat const *fmt = gnm_style_get_format (s);
+			const char *xlfmt = go_format_as_XL (fmt);
+			guint16 bytes;
+			unsigned afterpos, lenpos = bp->curpos;
+
+			/* Write as DXFNumUsr structure. */
+			ms_biff_put_var_seekto (bp, lenpos + 2);
+			bytes = excel_write_string
+				(bp, STR_TWO_BYTE_LENGTH, xlfmt);
+
+			afterpos = bp->curpos;
+			ms_biff_put_var_seekto (bp, lenpos);
+			GSF_LE_SET_GUINT16 (buf, bytes + 2);
+			ms_biff_put_var_write (bp, buf, 2);
+			ms_biff_put_var_seekto (bp, afterpos);
+
+			flags |= 0x02000000;
+			flags2 |= 0x1;
+		}
+
+		if (gnm_style_is_element_set (s, MSTYLE_FONT_COLOR) ||
+		    gnm_style_is_element_set (s, MSTYLE_FONT_NAME) ||
 		    gnm_style_is_element_set (s, MSTYLE_FONT_BOLD) ||
 		    gnm_style_is_element_set (s, MSTYLE_FONT_ITALIC) ||
 		    gnm_style_is_element_set (s, MSTYLE_FONT_UNDERLINE ) ||
@@ -1123,9 +1145,17 @@ cb_write_condition (GnmStyleConditions const *sc, CondDetails *cd,
 		    gnm_style_is_element_set (s, MSTYLE_FONT_SIZE)) {
 			guint8 fbuf[118];
 			guint32 tmp, font_flags = 0x18;
+			guint32 written = 0;
 
 			memset (fbuf, 0, sizeof (fbuf));
 
+			if (gnm_style_is_element_set (s, MSTYLE_FONT_NAME)) {
+				const char *font = gnm_style_get_font_name (s);
+
+				written = excel_write_string
+					(bp, STR_ONE_BYTE_LENGTH, font);
+			}
+
 			if (gnm_style_is_element_set (s, MSTYLE_FONT_SIZE))
 				tmp = (int) (gnm_style_get_font_size (s) * 20. + .5);
 			else
@@ -1180,7 +1210,9 @@ cb_write_condition (GnmStyleConditions const *sc, CondDetails *cd,
 
 			GSF_LE_SET_GUINT8 (fbuf + 88, font_flags);
 
-			ms_biff_put_var_write (bp, fbuf, sizeof (fbuf));
+			ms_biff_put_var_write (bp,
+					       fbuf + written,
+					       sizeof (fbuf) - written);
 			flags |= 0x04000000;
 		}
 
@@ -1364,7 +1396,7 @@ cb_write_condition (GnmStyleConditions const *sc, CondDetails *cd,
 		GSF_LE_SET_GUINT16 (buf+2, expr0_len);
 		GSF_LE_SET_GUINT16 (buf+4, expr1_len);
 		GSF_LE_SET_GUINT32 (buf+6, flags);
-		GSF_LE_SET_GUINT16 (buf+10, 2);  /* We have seen 2 and 0x802 */
+		GSF_LE_SET_GUINT16 (buf+10, flags2);
 		ms_biff_put_var_write (bp, buf, 12);
 
 		ms_biff_put_commit (bp);
