# Convert a list of RGB values to CMYK

#### jdonnelly

##### New Member
I have a list of RGB values that I would like to convert to CMYK values. I've located some help that will requires the values be entered manually. I would like to read the list and convert.

Thanks!

### Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

#### Rick Rothstein

##### MrExcel MVP
Can you tell us where your RGB values are located and tell us where you want the CYMK values to be placed and whether you want a formula solution or VBA solution?

#### Rick Rothstein

##### MrExcel MVP
Where did you go? You were online when I asked my question. Okay, I'll assume your RGB values are in separate columns (Columns A, B, C for R, G, B respectively) and that your output is to go in Columns D, E, F, G (for C, M, Y, K respectively). Also, I am assuming Row 1 is used for headers. With that said, put these formulas in the indicated cells and copy them down...

D2: =(1-\$G2-A2/255)/(1-\$G2)

E2: =(1-\$G2-B2/255)/(1-\$G2)

F2: =(1-\$G2-C2/255)/(1-\$G2)

G2: =1-MAX(A2/255,B2/255,C2/255)

Make sure to format the cells in Columns D, E, F, G as Percentage with zero decimal points.

#### Jon Peltier

##### MrExcel MVP
Rick, we need to prevent to prevent #DIV/0 errors for black, that is, RGB(0, 0, 0). It might be as simple as

D2: =(1-\$G2-A2/255)/(1-IF(\$G2=1,0,\$G2))
E2: =(1-\$G2-B2/255)/(1-IF(\$G2=1,0,\$G2))
F2: =(1-\$G2-C2/255)/(1-IF(\$G2=1,0,\$G2))

#### Rick Rothstein

##### MrExcel MVP

Good catch Jon. If I had noticed that problem, I probably would have opted to use IFERROR...

D2: =IFERROR((1-\$G2-A2/255)/(1-\$G2),)
E2: =IFERROR((1-\$G2-B2/255)/(1-\$G2),)
F2: =IFERROR((1-\$G2-C2/255)/(1-\$G2),)

#### Jon Peltier

##### MrExcel MVP
Yep, that works, too.

#### jdonnelly

##### New Member
Rick and Jon, Thank you both for your assistance with this issue. Rick, you assumptions regarding how the columns are setup are correct. We now have a solution in place for this challenge.

Thanks!

Replies
9
Views
74
Replies
6
Views
498
Replies
1
Views
42
Replies
0
Views
46
Replies
4
Views
119

1,127,098
Messages
5,622,683
Members
415,920
Latest member
ExcelNoob28

### 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.

### Which adblocker are you using?

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

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