Make a blank cell = 0

Mcls2020

New Member
Joined
Feb 6, 2020
Messages
18
Office Version
  1. 365
Platform
  1. MacOS
Dear all,

I hope that you are all well. Happy New Year :)

I am using the below formula, which is working fine, but I need the blank cell to give a value:
=IF(K6="Set 1 Sounds Group A","1",IF(K6="Set 1 Sounds Group B","2",IF(K6="Set 1 Sounds Group C","3",IF(K6="Ditty Group","4",IF(K6="Red Group","5",IF(K6="Green Group","6",IF(K6="Purple Group","7",IF(K6="Pink Group","8",IF(K6="Orange Group","9",IF(K6="Completed","14",IF(K6="Yellow Group","10",IF(K6="Blue Group","11",IF(K6="Grey Group","12",IF(K6=0,"",IF(K6="Comprehension","13",IF(K6="","0",IF(K6="Literacy and Language","13")))))))))))))))))

If I add K6 as a blank cell it is still returning it to an empty cell. I checked the setting in Excel to see if it was showing view '0'. I tried to change the value to a different number and it still does not show. Is there any way I can fix this without putting any information in the K6 cell?

Thank you.

Kind regards,

Matt
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Use the N() function
Mr Excel Questions.xlsx
GHI
2
3564564
40
5dafdsf0
6445fdf65460
71/20/202646042
8
Sheet2
Cell Formulas
RangeFormula
H3:H7H3=N(G3)
 
Upvote 0
It's is returning "" because of this part of the formula
Excel Formula:
IF(K6=0,"",
 
Upvote 0
@Mcls2020. Sorry, about my erroneous suggestion earlier. I did not test against your formula, as it required creating the spreadsheet.
I could not figure out why excel does that. But, I did get a formula that maps the blank cell to a "0". I did by using an ISBLANK in the first part of the main formula. I also did using the SWITCH function as well as the nested IFs. I don't see any dependency upon order of the edit (other than performance) so the ISBLANK at the start shouldn't affect the result. In the sheet below I have ISBLANK at the top of both, the switch and the nested ifs in the first two columns of formulas. The 3rd formula column has an ISBLANK check in the original location.
WorkBook1.xlsx
KLMNOP
5SWITCHNESTED IF w ISBLANK at TopISBLANK in Orig Location
6Set 1 Sounds Group A111
7Set 1 Sounds Group B222
8Set 1 Sounds Group C333
9Ditty Group444
10Red Group555
11Green Group666
12Purple Group777
13Pink Group888
14Orange Group999
15Completed141414
16Yellow Group101010
17Blue Group111111
18Grey Group121212
190   
200   
21Comprehension131313
2200 
23Literacy and Language131313
Sheet2
Cell Formulas
RangeFormula
N6:N23N6=IF(ISBLANK(K6),"0",SWITCH( K6,"Set 1 Sounds Group A","1", "Set 1 Sounds Group B","2", "Set 1 Sounds Group C","3", "Ditty Group","4", "Red Group","5", "Green Group","6", "Purple Group","7", "Pink Group","8", "Orange Group","9", "Completed","14", "Yellow Group","10", "Blue Group","11", "Grey Group","12", "0","", 0,"", "Comprehension","13", "Literacy and Language","13"))
O6:O23O6=IF(ISBLANK(K6),"0",IF(K6="Set 1 Sounds Group A","1", IF(K6="Set 1 Sounds Group B","2", IF(K6="Set 1 Sounds Group C","3", IF(K6="Ditty Group","4", IF(K6="Red Group","5", IF(K6="Green Group","6", IF(K6="Purple Group","7", IF(K6="Pink Group","8", IF(K6="Orange Group","9", IF(K6="Completed","14", IF(K6="Yellow Group","10", IF(K6="Blue Group","11", IF(K6="Grey Group","12", IF(K6=0,"", IF(K6="0","", IF(K6="Comprehension","13", IF(K6="Literacy and Language","13","END" ))))))))))))))))))
P6:P23P6=IF(K6="Set 1 Sounds Group A","1", IF(K6="Set 1 Sounds Group B","2", IF(K6="Set 1 Sounds Group C","3", IF(K6="Ditty Group","4", IF(K6="Red Group","5", IF(K6="Green Group","6", IF(K6="Purple Group","7", IF(K6="Pink Group","8", IF(K6="Orange Group","9", IF(K6="Completed","14", IF(K6="Yellow Group","10", IF(K6="Blue Group","11", IF(K6="Grey Group","12", IF(K6=0,"", IF(K6="0","", IF(K6="Comprehension","13", IF(ISBLANK(K6),"0", IF(K6="Literacy and Language","13","END" ))))))))))))))))))
 
Upvote 0
@Mcls2020. Sorry, about my erroneous suggestion earlier. I did not test against your formula, as it required creating the spreadsheet.
I could not figure out why excel does that. But, I did get a formula that maps the blank cell to a "0". I did by using an ISBLANK in the first part of the main formula. I also did using the SWITCH function as well as the nested IFs. I don't see any dependency upon order of the edit (other than performance) so the ISBLANK at the start shouldn't affect the result. In the sheet below I have ISBLANK at the top of both, the switch and the nested ifs in the first two columns of formulas. The 3rd formula column has an ISBLANK check in the original location.
WorkBook1.xlsx
KLMNOP
5SWITCHNESTED IF w ISBLANK at TopISBLANK in Orig Location
6Set 1 Sounds Group A111
7Set 1 Sounds Group B222
8Set 1 Sounds Group C333
9Ditty Group444
10Red Group555
11Green Group666
12Purple Group777
13Pink Group888
14Orange Group999
15Completed141414
16Yellow Group101010
17Blue Group111111
18Grey Group121212
190   
200   
21Comprehension131313
2200 
23Literacy and Language131313
Sheet2
Cell Formulas
RangeFormula
N6:N23N6=IF(ISBLANK(K6),"0",SWITCH( K6,"Set 1 Sounds Group A","1", "Set 1 Sounds Group B","2", "Set 1 Sounds Group C","3", "Ditty Group","4", "Red Group","5", "Green Group","6", "Purple Group","7", "Pink Group","8", "Orange Group","9", "Completed","14", "Yellow Group","10", "Blue Group","11", "Grey Group","12", "0","", 0,"", "Comprehension","13", "Literacy and Language","13"))
O6:O23O6=IF(ISBLANK(K6),"0",IF(K6="Set 1 Sounds Group A","1", IF(K6="Set 1 Sounds Group B","2", IF(K6="Set 1 Sounds Group C","3", IF(K6="Ditty Group","4", IF(K6="Red Group","5", IF(K6="Green Group","6", IF(K6="Purple Group","7", IF(K6="Pink Group","8", IF(K6="Orange Group","9", IF(K6="Completed","14", IF(K6="Yellow Group","10", IF(K6="Blue Group","11", IF(K6="Grey Group","12", IF(K6=0,"", IF(K6="0","", IF(K6="Comprehension","13", IF(K6="Literacy and Language","13","END" ))))))))))))))))))
P6:P23P6=IF(K6="Set 1 Sounds Group A","1", IF(K6="Set 1 Sounds Group B","2", IF(K6="Set 1 Sounds Group C","3", IF(K6="Ditty Group","4", IF(K6="Red Group","5", IF(K6="Green Group","6", IF(K6="Purple Group","7", IF(K6="Pink Group","8", IF(K6="Orange Group","9", IF(K6="Completed","14", IF(K6="Yellow Group","10", IF(K6="Blue Group","11", IF(K6="Grey Group","12", IF(K6=0,"", IF(K6="0","", IF(K6="Comprehension","13", IF(ISBLANK(K6),"0", IF(K6="Literacy and Language","13","END" ))))))))))))))))))
Thank you so much. That worked very well.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,267
Members
449,075
Latest member
staticfluids

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